Instructions to use sarvamai/sarvam-translate with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sarvamai/sarvam-translate 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="sarvamai/sarvam-translate")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("sarvamai/sarvam-translate") model = AutoModelForMultimodalLM.from_pretrained("sarvamai/sarvam-translate", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Output Token Repetition – Produces Gibberish
#7
by Ranjit - opened
Thanks for reporting the issue. We found a minor issue in the README which we have corrected now.
To the tokenizer.apply_chat_template method, we need to pass add_generation_prompt=True when we run HF inference using model.generate method.
Please try it out and let us know if you still face issues.
The output from the model now seems same as what you see on the playground.
rahular changed discussion status to closed
Yes it is, Thanks!

