Helsinki-NLP/tatoeba
Updated • 1.58k • 55
How to use Pythongirl/flan-t5-small-tatoeba-en-tok-v0.1 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="Pythongirl/flan-t5-small-tatoeba-en-tok-v0.1") # Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("Pythongirl/flan-t5-small-tatoeba-en-tok-v0.1")
model = AutoModelForSeq2SeqLM.from_pretrained("Pythongirl/flan-t5-small-tatoeba-en-tok-v0.1", device_map="auto")Model to translate English to toki pona. Use the instruction prompt "translate English to toki pona: " or the builtin translation config.
Base model
google/flan-t5-small