Instructions to use facebook/nllb-200-3.3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use facebook/nllb-200-3.3B with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("translation", model="facebook/nllb-200-3.3B")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-3.3B") model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-200-3.3B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
model doesn't work in the hosted interface api
this is the error that returns when trying to use the model on the api:
Can't load tokenizer using from_pretrained, please update its configuration: Tokenizer class NllbTokenizer does not exist or is not currently imported.
Hey @labx , NLLB models require the NllbTokenizer, as you have seen.
These are being contributed in this PR: https://github.com/huggingface/transformers/pull/18126
Please check it out and let us know in the PR comments if it works as expected for you!
Thanks.
@lysandre He is describing an error with the model's hosted inference API, not his code.
I don't know if this is still the error because it returns this error instead when I run it:
"Model facebook/nllb-200-3.3B time out"