tgt_text = "La vie est comme une boîte de chocolat."
model_inputs = tokenizer(src_text, return_tensors="pt")
with tokenizer.as_target_tokenizer():
    labels = tokenizer(tgt_text, return_tensors="pt").input_ids
loss = model(**model_inputs, labels=labels)  # forward pass
```
Generation
M2M100 uses the eos_token_id as the decoder_start_token_id for generation with the target language id
  being forced as the first generated token. To force the target language id as the first generated token, pass the
  forced_bos_token_id parameter to the generate method. The following example shows how to translate between
  Hindi to French and Chinese to English using the facebook/m2m100_418M checkpoint.
```python
from transformers import M2M100ForConditionalGeneration, M2M100Tokenizer
hi_text = "जीवन एक चॉकलेट बॉक्स की तरह है।"
