Downloads · 30 days
7
16% of all-time downloads
prasadvittaldev/gemma4-tamil-e4b-it
gemma4-tamil-e4b-it is a machine learning model from prasadvittaldev. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as cc-by-nc-4.0.
A Tamil-fluent, Tanglish-tolerant instruction-tuned fine-tune of Gemma 4 E4B, trained via QLoRA (Unsloth) on a combined Tamil instruction dataset. Built as the LLM stage of a Tamil voice-assistant pipeline (paired wit…
Downloads · 30 days
7
16% of all-time downloads
All-time downloads
43
Public
Parameters
8B
16 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors16 GB · 100%
From the Hugging Face model README
A Tamil-fluent, Tanglish-tolerant instruction-tuned fine-tune of Gemma 4 E4B, trained via QLoRA (Unsloth) on a combined Tamil instruction dataset. Built as the LLM stage of a Tamil voice-assistant pipeline (paired with a Tamil STT front-end and an Orpheus-based Tamil TTS back-end).
{"messages": [...]} chat format compatible with Gemma's chat template, with light per-source cleanup (stratified sampling where a source was too large, Tamil-majority filtering for the code-switching source).unsloth/gemma-4-E4B-it-unsloth-bnb-4bit (Gemma 4 E4B, instruction-tuned, 4-bit)prasadvittaldev/gemma4-tamil-sft — combined and deduplicated from 4 sources:
Cognitive-Lab/Aya_Tamil (stratified sample, ~150K rows)ai4bharat/indic-align (Wiki_Chat, HHRLHF_T, Toxic_Matrix configs, Tamil-extracted)abhinand/tamil-alpaca-orca (full, ~145K rows)Chat2Find/Chat2Find-Instruct-Reasoning-Sample (Tamil-majority filtered, Tanglish/code-switching)Released under CC-BY-NC-4.0 (non-commercial). This is not the same as Gemma 4's own Apache 2.0 license — the more restrictive non-commercial terms are used here because part of the training mix (abhinand/tamil-alpaca-orca) carries a non-commercial license (its Alpaca-derived half). This model may be used for research, evaluation, and personal projects, but not commercial deployment or resale. If you need a fully commercial-use model, retrain on the same pipeline with that source excluded.
Tamil-language instruction following and conversation, with tolerance for natural Tamil-English code-switching ("Tanglish") common in everyday Tamil speech/chat. Designed as the reasoning/response-generation stage of a real-time Tamil voice assistant.
Step 1 — install dependencies:
pip install transformers torch accelerate bitsandbytes
Step 2 — load the tokenizer and model. The full model is ~16GB in bf16; on a 16GB GPU, load it 4-bit quantized to leave headroom for generation. On a larger GPU (24GB+), you can load it directly in bf16 instead (drop the quantization_config argument and use dtype=torch.bfloat16).
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
MODEL = "prasadvittaldev/gemma4-tamil-e4b-it"
tokenizer = AutoTokenizer.from_pretrained(MODEL)
quant_config = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_compute_dtype=torch.bfloat16)
model = AutoModelForCausalLM.from_pretrained(MODEL, quantization_config=quant_config, device_map="cuda")
Step 3 — format your prompt as a chat message (a list of {"role": ..., "content": ...} dicts):
messages = [{"role": "user", "content": "தமிழ் மொழியின் வரலாறு பற்றி சுருக்கமாக சொல்லுங்கள்."}]
Step 4 — apply the chat template and move inputs to the GPU:
inputs = tokenizer.apply_chat_template(
messages, add_generation_prompt=True, return_tensors="pt", return_dict=True
).to("cuda")
Step 5 — generate a response:
output = model.generate(**inputs, max_new_tokens=200)
Step 6 — decode only the newly generated tokens (skip the prompt you passed in):
response = tokenizer.decode(output[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True)
print(response)
For questions, feedback, or further discussion, reach out at [email protected].