Downloads · 30 days
0
RakshithFury/qwen3-4b-codemixed-kan-en
qwen3-4b-codemixed-kan-en is a text generation model from RakshithFury. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as cc-by-nc-4.0.
A Kannada-English Kanglish normalizer fine-tuned from unsloth/Qwen3-4B on my local 5070Ti alongside a Ryzen 7 9700x. Trained for only 2.5 hours on 22000 examples.
Downloads · 30 days
0
Access
Public
Updated Jul 23, 2026
Parameters
4B
8.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors8 GB · 100%
From the Hugging Face model README
A Kannada-English Kanglish normalizer fine-tuned from unsloth/Qwen3-4B on my local 5070Ti alongside a Ryzen 7 9700x. Trained for only 2.5 hours on 22000 examples.
This model converts informal Kannada written in Roman script, Kannada script, English, or mixed Kannada-English form into structured JSON containing:
ivattu office ge baralla swalpa fever ide
{
"english_translation": "I cannot come to the office today because I have a slight fever.",
"formal_kannada": "ಇಂದು ಸ್ವಲ್ಪ ಜ್ವರ ಇರುವುದರಿಂದ ಕಚೇರಿಗೆ ಬರಲು ಸಾಧ್ಯವಿಲ್ಲ.",
"kannada_script": "ಇವತ್ತು ಆಫೀಸಿಗೆ ಬರಲ್ಲ, ಸ್ವಲ್ಪ ಜ್ವರ ಇದೆ.",
"normalized_kannada": "ಇವತ್ತು ಆಫೀಸಿಗೆ ಬರಲ್ಲ, ಸ್ವಲ್ಪ ಜ್ವರ ಇದೆ.",
"tokens": [
{"lang": "kn_roman", "text": "ivattu"},
{"lang": "en", "text": "office"},
{"lang": "kn_roman", "text": "ge"},
{"lang": "kn_roman", "text": "baralla"},
{"lang": "kn_roman", "text": "swalpa"},
{"lang": "en", "text": "fever"},
{"lang": "kn_roman", "text": "ide"}
]
}
Input - "nanu ellige barabeku"
FT model -
Output (English) - "I need to be where"
Output (Kannada) - "ನನು ಎಲ್ಲಿಗೆ ಬರಬೇಕು"
Default Model -
Output (English) - "I am here with a barbecue"
Output (Kannada) - ನ"ಾನು ಇಲ್ಲಿ ಬರ್ಬೆಕ್ಯೂ ಇದೆ"
This model is designed for:
It is not intended to be a general-purpose chatbot.
The model is trained to return JSON only:
{
"kannada_script": "string",
"normalized_kannada": "string",
"formal_kannada": "string",
"english_translation": "string",
"tokens": [
{
"text": "string",
"lang": "kn_roman | kn | en | name | number | punctuation | other"
}
]
}
unsloth/Qwen3-4BThe training data was built from three sources:
Used for Kannada word-level romanization and transliteration supervision.
This teaches the model mappings such as:
ivattu -> ಇವತ್ತು
nange -> ನನಗೆ
madbeku -> ಮಾಡಬೇಕು
Used to create synthetic sentence-level Kanglish examples.
The pipeline converts Kannada sentences into romanized/noisy Kanglish inputs and uses the original Kannada and English sentence pair as supervision.
A hand-written JSONL file of high-quality Kanglish examples was added to teach realistic chat-style Kannada, code-mixing, formal rewriting, and practical phrase usage.
Example categories include:
The preprocessing pipeline creates examples of this form:
{
"source": "manual_gold",
"messages": [
{
"role": "system",
"content": "You are a Kannada-English Kanglish normalizer..."
},
{
"role": "user",
"content": "nange ee application submit madbeku"
},
{
"role": "assistant",
"content": "{\"kannada_script\":\"ನನಗೆ ಈ ಅಪ್ಲಿಕೇಶನ್ ಸಲ್ಲಿಸಬೇಕು.\",...}"
}
]
}
The final generated dataset used for the first run contained:
1379792000Initial training configuration:
model_name: unsloth/Qwen3-4B
max_seq_length: 2048
load_in_4bit: true
method: qlora
lora_r: 32
lora_alpha: 64
lora_dropout: 0
target_modules:
- q_proj
- k_proj
- v_proj
- o_proj
- gate_proj
- up_proj
- down_proj
per_device_train_batch_size: 2
gradient_accumulation_steps: 2
effective_batch_size: 4
learning_rate: 2e-4
lr_scheduler_type: cosine
warmup_ratio: 0.03
optimizer: adamw_8bit
epochs: 1
bf16: true
packing: false
gradient_checkpointing: true
power drawn: approx 230W for 2hrs
Max temperature: 63C
Install dependencies:
pip install unsloth transformers peft trl accelerate bitsandbytes
Load the model:
import torch
from unsloth import FastLanguageModel
model_name = "RakshithFury/qwen3-4b-kanglish-normalizer-lora"
model, tokenizer = FastLanguageModel.from_pretrained(
model_name=model_name,
max_seq_length=2048,
dtype=None,
load_in_4bit=True,
)
FastLanguageModel.for_inference(model)
Run inference:
SYSTEM_PROMPT = """You are a Kannada-English Kanglish normalizer.
Given informal Kannada written in Roman script, Kannada script, English, or mixed form, return strict JSON with:
- kannada_script: the best Kannada-script rendering of the input
- normalized_kannada: natural Kannada preserving the input's register
- formal_kannada: polite/formal Kannada
- english_translation: faithful English meaning
- tokens: token-level language tags using kn_roman, kn, en, name, number, punctuation, other
Do not add facts. Preserve names, numbers, dates, URLs, and technical terms.
Return JSON only."""
messages = [
{"role": "system", "content": SYSTEM_PROMPT},
{"role": "user", "content": "ivattu office ge baralla swalpa fever ide"},
]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
enable_thinking=False,
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=512,
do_sample=False,
)
response = tokenizer.decode(
outputs[0][inputs["input_ids"].shape[1]:],
skip_special_tokens=True,
)
print(response)
For deterministic normalization, use greedy decoding:
do_sample=False
temperature=None
top_p=None
For production use, validate that the output parses as JSON. If parsing fails, retry once with the same prompt and lower max_new_tokens, or use a JSON repair step.
The model may struggle with:
This model is a text normalization model. It should not be used as the sole authority for:
For user-facing systems, show the normalized output for review when accuracy matters.
This model card lists cc-by-nc-4.0 because the current training pipeline uses Samanantar, whose Hugging Face dataset card lists a non-commercial Creative Commons license.
If you retrain without non-commercial data, update the license accordingly.
If you use this model or dataset, please cite the upstream resources used in the pipeline:
@misc{kanglish_normalizer_qwen3_4b_lora,
title = {Qwen3 4B Kanglish Normalizer LoRA},
author = {Rakshith Rao},
year = {2026},
publisher = {Hugging Face},
note = {Kannada-English Kanglish normalization model}
}