Downloads · 30 days
9
2% of all-time downloads
dmedhi/eng2french-t5-small
eng2french-t5-small is a translation model from dmedhi. Use it when you need text moved from one language to another. It is set up for peft. The card lists the license as apache-2.0.
A language translation model fine-tuned on opus100 dataset for English to French translation.
Downloads · 30 days
9
2% of all-time downloads
All-time downloads
439
Public
Repo size
1.7 MB
Likes
0
Public
Click a slice to open those files.
.json2.4 MB · 59%
From the Hugging Face model README
A language translation model fine-tuned on opus100 dataset for English to French translation.
The model is intended to use for English to French translation related tasks.
Install necessary libraries
pip install transformers peft accelerate
Use the code below to get started with the model.
from peft import PeftModel, PeftConfig
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("dmedhi/eng2french-t5-small")
model = AutoModelForSeq2SeqLM.from_pretrained("t5-small")
model = PeftModel.from_pretrained(model, "dmedhi/eng2french-t5-small")
context = tokenizer(["Do you want coffee?"], return_tensors='pt')
output = model.generate(**context)
result = tokenizer.decode(output[0], skip_special_tokens=True)
print(result)
# Output
# Tu veux du café?