Instructions to use jbochi/madlad400-3b-mt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jbochi/madlad400-3b-mt 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="jbochi/madlad400-3b-mt")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("jbochi/madlad400-3b-mt") model = AutoModelForSeq2SeqLM.from_pretrained("jbochi/madlad400-3b-mt") - Notebooks
- Google Colab
- Kaggle
Translation of longer texts
#13
by hanshupe - opened
It seems that only very short texts like 1 sentence are supported. I am wondering if I am missing something, or how would you use it to translate a few pages of texts?
Hello. You'd have to break the text into sentences, and translate the sentences individually.
I thought so too, but its not even able to translate one sentence but stops after like 10 words sometimes. Can you specify the max length? I am using Farsi as a source and English as target language.