Downloads · 30 days
11
6% of all-time downloads
gopi30/english-to-tamil-stage2
english-to-tamil-stage2 is a translation model from gopi30. Use it when you need text moved from one language to another. It is set up for transformers.
Model ID: gopi30/english-to-tamil-stage2 Model Type: M2M100ForConditionalGeneration Language Pair: English ➡ Tamil Framework: 🤗 Transformers
Downloads · 30 days
11
6% of all-time downloads
All-time downloads
188
Public
Parameters
484M
3.9 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.9 GB · 100%
From the Hugging Face model README
Model ID: gopi30/english-to-tamil-stage2
Model Type: M2M100ForConditionalGeneration
Language Pair: English ➡ Tamil
Framework: 🤗 Transformers
This model is the Stage 2 fine-tuned version of Facebook's M2M100 (418M) Multilingual Machine Translation model for English-to-Tamil translation. It builds on the improvements made in Stage 1 and incorporates more targeted domain-specific training to enhance translation fluency, contextual accuracy, and Tamil grammar structure.
facebook/m2m100_418Men ➡ taMake sure you have the transformers library installed:
pip install transformers
from transformers import M2M100ForConditionalGeneration, M2M100Tokenizer
model_path = "gopi30/english-to-tamil-stage2"
model = M2M100ForConditionalGeneration.from_pretrained(model_path)
tokenizer = M2M100Tokenizer.from_pretrained(model_path)
def translate_en_to_ta(text):
tokenizer.src_lang = "en"
encoded = tokenizer(text, return_tensors="pt")
generated = model.generate(**encoded, forced_bos_token_id=tokenizer.get_lang_id("ta"))
return tokenizer.decode(generated[0], skip_special_tokens=True)
# Example
print(translate_en_to_ta("Hello!"))