Downloads · 30 days
25
10% of all-time downloads
mihdeme/t5-fr-en-tatoeba
t5-fr-en-tatoeba is a translation model from mihdeme. Use it when you need text moved from one language to another. It is set up for transformers.
This is a fine-tuned version of google-t5/t5-small, trained on the Tatoeba dataset for French-to-English translation.
Downloads · 30 days
25
10% of all-time downloads
All-time downloads
253
Public
Parameters
60.5M
243 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors242 MB · 99%
From the Hugging Face model README
This is a fine-tuned version of google-t5/t5-small, trained on the Tatoeba dataset for French-to-English translation.
google-t5/t5-smallopus_tatoeba (French-English)from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
model_name = "mihdeme/t5-fr-en-tatoeba"
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)
def translate(sentence, max_length=460, num_beams=5):
inputs = tokenizer(f"translate French to English: {sentence}", return_tensors="pt", padding=True, truncation=True)
outputs = model.generate(
**inputs,
max_length=max_length,
num_beams=num_beams,
)
return tokenizer.decode(outputs[0], skip_special_tokens=True)
print(translate("Bonjour, comment ça va ?"))
Apache 2.0
Trained using Hugging Face Transformers. Original dataset from Tatoeba.