File size: 1,440 Bytes
1d17a0d b31d7aa 1d17a0d 2ea84ca 1d17a0d 2ea84ca b31d7aa 1d17a0d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
---
license: apache-2.0
language:
- en
- ta
pipeline_tag: translation
tags:
- tamil
- text-to-text
---
## Usage
To use this model, you can either directly use the Hugging Face `transformers` library or you can use the model via the Hugging Face inference API.
### Model Information
Training Details
- **This model has been fine-tuned for English to Tamil translation.**
- **Training Duration: Over 10 hours**
- **Loss Achieved: 0.6**
- **Model Architecture**
- **The model architecture is based on the Transformer architecture, specifically optimized for sequence-to-sequence tasks.**
## 🔥 Example Usage
Load and test the model using **Hugging Face Transformers**:
```python
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
# Load model and tokenizer
model_name = "aishu15/colloquial-tamil"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
# Function to translate text
def translate(text):
inputs = tokenizer(text, return_tensors="pt")
outputs = model.generate(**inputs, max_length=128)
return tokenizer.decode(outputs[0], skip_special_tokens=True)
# Example translations
test_sentences = [
"This is so beautiful",
"Bro, are you coming or not?",
"My mom is gonna kill me if I don't reach home now!"
]
for sentence in test_sentences:
print(f"English: {sentence}")
print(f"Colloquial Tamil: {translate(sentence)}\n") |