Instructions to use facebook/m2m100_418M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use facebook/m2m100_418M with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("facebook/m2m100_418M") model = AutoModelForSeq2SeqLM.from_pretrained("facebook/m2m100_418M") - Notebooks
- Google Colab
- Kaggle
Inference API is not working
I am trying to use the inference API to translate text but every time i pass src_lang and tgt_lang in parameters inside the body JSON I get this error
{
"error": "The following model_kwargs are not used by the model: ['tgt_lang', 'src_lang'] (note: typos in the generate arguments will also show up in this list)",
"warnings": [
"There was an inference error: The following model_kwargs are not used by the model: ['tgt_lang', 'src_lang'] (note: typos in the generate arguments will also show up in this list)"
]
}
And If i removed "parameters" from the JSON I get a randomly translated text, I even tried passing the target language and source language with the input like this " <e/n> Where's the park <a/r> " (Remove the slash) and it didn't work... How should I use the API ?