Translation
Transformers
PyTorch
Safetensors
marian
text2text-generation
opus-mt-tc
Eval Results (legacy)
Instructions to use Helsinki-NLP/opus-mt-tc-big-zle-it with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Helsinki-NLP/opus-mt-tc-big-zle-it 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="Helsinki-NLP/opus-mt-tc-big-zle-it")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("Helsinki-NLP/opus-mt-tc-big-zle-it") model = AutoModelForSeq2SeqLM.from_pretrained("Helsinki-NLP/opus-mt-tc-big-zle-it") - Notebooks
- Google Colab
- Kaggle
Update checkpoint for transformers>=4.29
#2
by ArthurZ HF Staff - opened
ArthurZ changed pull request status to merged
Automatically merging the PR.
Following the merge of a PR in transformers it appeared that this model was not properly converted. This PR will fix the inference and was tested using the following script:
>>> from transformers import AutoTokenizer, MarianMTModel
>>> tokenizer = AutoTokenizer.from_pretrained('Helsinki-NLP/opus-mt-tc-big-zle-it')
>>> inputs = tokenizer("' >>en<< Hey how are you?'", return_tensors="pt", padding=True)
>>> model = MarianMTModel.from_pretrained('Helsinki-NLP/opus-mt-tc-big-zle-it')
>>> print(tokenizer.batch_decode(model.generate(**inputs)))
["<pad> 'Hey how are you?'</s>"]