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 AutoModel model = AutoModel.from_pretrained("facebook/nllb-200-3.3B", dtype="auto") - Notebooks
- Google Colab
- Kaggle
how to handle multi-line string
#9
by StephennFernandes - opened
. i handle concurrent user request by dynamically batching them together and inferencing the as a batch.
However i wanted to know i i could somehow handle new line \n in my input string and the translated response retained the new line token somehow (eg: \n or any special token).
Ive tried other alternative solutions like slicing the input string on the \n and inferencing these separate pieces as a batch and merging them together, but concurrent throughput in my application suffers.
please let me know incase of a possible solution or a hacky way of how i could achieve this