Instructions to use gopi30/english-to-tamil-stage2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gopi30/english-to-tamil-stage2 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="gopi30/english-to-tamil-stage2")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("gopi30/english-to-tamil-stage2") model = AutoModelForSeq2SeqLM.from_pretrained("gopi30/english-to-tamil-stage2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
π English-to-Tamil Translation β Fine-Tuned M2M100 (Stage 2)
Model ID: gopi30/english-to-tamil-stage2
Model Type: M2M100ForConditionalGeneration
Language Pair: English β‘ Tamil
Framework: π€ Transformers
π Model Summary
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.
β Improvements Over Stage 1
- Trained with cleaner and more diverse parallel English-Tamil sentence pairs
- Better handling of idioms and complex sentence structures
- Enhanced translation consistency and Tamil morphology
- Optimized tokenizer usage for more accurate sentence segmentation
π Use Cases
- Translating English educational content to Tamil
- Localizing web and mobile apps for Tamil-speaking audiences
- Assisting in communication for native Tamil speakers
- Voice assistants and accessibility tools
π§© Base Model
- Base:
facebook/m2m100_418M - Languages Fine-Tuned:
enβ‘ta
π¦ Installation
Make sure you have the transformers library installed:
pip install transformers
Via Transformers Library
Code
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!"))
- Downloads last month
- 7