πŸ€– English-to-Tamil Translation β€” Fine-Tuned M2M100 Model

Model ID: gopi30/english-to-tamil-stage1
Model Type: M2M100ForConditionalGeneration
Language Pair: English ➑ Tamil
Framework: πŸ€— Transformers


πŸ“Œ Model Summary

This model is a fine-tuned version of Facebook's M2M100 (Multilingual Machine Translation model) for English-to-Tamil translation. It supports direct translation from English to Tamil and has been trained to better understand domain-specific and culturally relevant Tamil phrases.

The base model used is facebook/m2m100_418M.


πŸ“ˆ Use Cases

  • Translating English text into Tamil for communication, media, and content localization.
  • Language support in applications like voice assistants, educational tools, and accessibility services.

Installation

To use this model, you'll need to have the transformers library installed.

pip install transformers

Via Transformers Library

Code

from transformers import M2M100ForConditionalGeneration, M2M100Tokenizer

model_path = "gopi30/english-to-tamil-stage1"

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
70
Safetensors
Model size
484M params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support