text = "translate English to French: Legumes share resources with nitrogen-fixing bacteria."

The simplest way to try out your finetuned model for inference is to use it in a [pipeline]. Instantiate a pipeline for translation with your model, and pass your text to it:

from transformers import pipeline
translator = pipeline("translation", model="my_awesome_opus_books_model")
translator(text)
[{'translation_text': 'Legumes partagent des ressources avec des bactéries azotantes.'}]