Downloads · 30 days
44
30% of all-time downloads
sarthaksenapati/qwen1.5b-hinglish-sft-v2
qwen1.5b-hinglish-sft-v2 is a text generation model from sarthaksenapati. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
A LoRA adapter that fine-tunes Qwen2.5-1.5B-Base into a Hindi–English (Hinglish) code-switched assistant. The base model is a document completer; this adapter teaches it to follow instructions and reply in natural rom…
Downloads · 30 days
44
30% of all-time downloads
All-time downloads
149
Public
Repo size
159 MB
Likes
1
Public
Click a slice to open those files.
.safetensors148 MB · 93%
From the Hugging Face model README
A LoRA adapter that fine-tunes Qwen2.5-1.5B-Base into a Hindi–English (Hinglish) code-switched assistant. The base model is a document completer; this adapter teaches it to follow instructions and reply in natural romanized Hinglish (with English and some Devanagari Hindi support).
This is the SFT (v2) stage of an SFT → DPO project; the DPO stage (now available) addresses some of the limitations below.
Next stage: This SFT model is the reference for a DPO-aligned version that is preferred 68.2% of the time over this one (held-out, blind judge) with no capability loss — see
qwen1.5b-hinglish-dpoand the writeup Part 2: Preference Optimization with DPO.
A lightweight assistant for everyday, low-stakes tasks in Hinglish: recipes, simple how-tos, travel/tech/daily-life questions, short writing help. Best for romanized Hinglish input.
A starting checkpoint for further alignment (DPO/IPO/KTO) on Hinglish preference data, or for task-specific fine-tuning on Indic code-switched applications.
Not safety-aligned and not suitable for high-stakes use — medical, legal, or financial advice; factual lookups requiring reliability; or any application where confident misinformation is harmful. Do not deploy without a moderation/guardrail layer.
eos_token_id,
repetition_penalty, no_repeat_ngram_size) and a max_new_tokens cap. This was a target of
the DPO stage, which reduced but did not fully eliminate verbosity (see the DPO model).Use only for casual, low-stakes Hinglish interaction; keep a human in the loop; apply the recommended decoding settings; treat any factual/health/financial content as unverified.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
BASE = "Qwen/Qwen2.5-1.5B"
ADAPTER = "sarthaksenapati/qwen1.5b-hinglish-sft-v2"
# the model was trained with a plain ChatML template (no system prompt)
CHATML = ("{% for m in messages %}"
"{{ '<|im_start|>' + m['role'] + '\n' + m['content'] + '<|im_end|>' + '\n' }}"
"{% endfor %}"
"{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}")
tok = AutoTokenizer.from_pretrained(ADAPTER)
tok.chat_template = CHATML
im_end = tok.convert_tokens_to_ids("<|im_end|>")
bnb = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16, bnb_4bit_use_double_quant=True)
base = AutoModelForCausalLM.from_pretrained(BASE, quantization_config=bnb,
device_map="auto", dtype=torch.bfloat16)
model = PeftModel.from_pretrained(base, ADAPTER).eval()
msgs = [{"role": "user", "content": "Yaar mera laptop bahut slow hai, kuch quick fixes batao."}]
text = tok.apply_chat_template(msgs, add_generation_prompt=True, tokenize=False)
ids = tok(text, return_tensors="pt", add_special_tokens=False).to(model.device)
out = model.generate(**ids, max_new_tokens=200, do_sample=False,
repetition_penalty=1.2, no_repeat_ngram_size=3,
eos_token_id=im_end, pad_token_id=tok.eos_token_id)
print(tok.decode(out[0][ids.input_ids.shape[1]:], skip_special_tokens=True))
10,000 instruction–response pairs (sarthaksenapati/khichdi-sft), ~80% romanized Hinglish /
12% English / 8% Devanagari Hindi. Built via a two-stage synthetic pipeline (Self-Instruct style,
Llama-3.3-70B), then heuristic cleaning, language-ID relabeling, LLM-as-judge quality scoring
(1–10 rubric), MinHash near-deduplication, and a disjoint train / preference / eval split.
QLoRA: frozen 4-bit (NF4, double-quant) base + bf16 LoRA adapters on all seven linear projections.
Chat formatting and loss masking were done manually (prompt tokens set to -100; loss on the
assistant turn including <|im_end|>), with a plain transformers Trainer.
ChatML formatting; loss computed only on assistant tokens; <|im_end|> force-appended on any
sequence exceeding the max length so every example ends with the stop token.
~43 min on one RTX 4090 (24 GB). Trainable params 36.9M / 1.58B (≈2.34%). Adapter ≈148 MB.
A 5% held-out validation split of the training set for eval_loss, plus a disjoint set of 300
held-out eval prompts (never seen in training) used for the win-rate and MMLU evaluation.
eval_loss).SFT converts the base model into a Hinglish instruction-follower that is overwhelmingly preferred over base with no capability tax. Remaining issues (clean stopping, verbosity, Devanagari quality) are documented above and were addressed in the DPO stage (now available).
LoRA adapter over the decoder-only Qwen2.5-1.5B transformer. Objective: causal-LM cross-entropy on assistant tokens only (prompt masked).
Single RTX 4090 (RunPod).
transformers 5.x, peft 0.19.1, bitsandbytes, accelerate, datasets, Weights & Biases.
If you use this, please cite the repository and blog:
@misc{khichdi2026,
title = {Khichdi: post-training Qwen2.5-1.5B into a Hinglish assistant (SFT -> DPO)},
author = {Senapati, Sarthak},
year = {2026},
url = {https://github.com/sarthaksenapati/khichdi-hinglish-llm}
}
Sarthak Senapati
https://github.com/sarthaksenapati