YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

🧠 Gemma Fine-Tuned Model — Tamil/English → Tanglish Conversion

📘 Model Overview

This model is a fine-tuned version of Google's Gemma model, trained for Tamil and English to Tanglish (Romanized Tamil) conversion.
It follows an instruction-based fine-tuning format inspired by Alpaca/Vicuna-style instruction datasets.


🧩 Task

  • Primary Objective: Convert mixed Tamil/English text into Tanglish (Romanized Tamil).
  • Example:
    • Input: "நீங்கள் எப்படி இருக்கிறீர்கள்?"
    • Output: "Neenga eppadi irukeenga?"

⚙️ Installation & Setup

pip install torch transformers accelerate

🚀 Load Model from Hugging Face

from transformers import AutoTokenizer, AutoModelForCausalLM

model_name = "mdabucse/gemma-finetuned-tanglish"

tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype="auto",
    device_map="auto"
)

💬 Input Injection Template

This is the prompt structure used for both training and inference:

test_text = """### Instruction:
Convert Tamil/English to Tanglish (Romanized Tamil).
### Input:
{context}
### Response:"""

You can inject your own input dynamically:

context = "நீங்கள் எப்படி இருக்கிறீர்கள்?"
prompt = test_text.format(context=context)

🧠 Example Inference

inputs = tokenizer(prompt, return_tensors="pt").to(model.device)

outputs = model.generate(
    **inputs,
    max_new_tokens=50,
    temperature=0.7,
    top_p=0.9,
)

print(tokenizer.decode(outputs[0], skip_special_tokens=True))

🧾 Sample Output

### Instruction:
Convert Tamil/English to Tanglish (Romanized Tamil).
### Input:
நீங்கள் எப்படி இருக்கிறீர்கள்?
### Response:
Neenga eppadi irukeenga?

🧰 Parameters Explanation

Parameter Description
max_new_tokens Maximum number of tokens to generate.
temperature Controls randomness (higher = more creative).
top_p Nucleus sampling cutoff for probabilistic control.
device_map Automatically maps model to available devices (GPU/CPU).
torch_dtype Uses optimal data type (e.g. float16) for faster inference.

🧑‍💻 Training Notes

  • Base Model: google/gemma-2b or google/gemma-7b
  • Objective: Instruction fine-tuning for transliteration tasks.
  • Data Type: JSON/CSV with fields: instruction, input, output
  • Tokenizer: Gemma tokenizer with added Tamil tokens if needed.

📄 License

This model inherits the Gemma license and the dataset license used for fine-tuning.
Check respective Hugging Face page for redistribution rights.


🏷️ Metadata

  • Author: Mohamed Abubakkar S
  • Framework: 🤗 Unsloth
  • Task Category: Text-to-Text (Transliteration / Romanization)
Downloads last month
1
Safetensors
Model size
0.3B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support