Views
No views yet
pavan-naik/mt-nllb-en-kn dataset.1import torch
2from unsloth import FastLanguageModel
3
4model, tokenizer = FastLanguageModel.from_pretrained(
5 model_name="kshitijdesai99/Qwen-3.5-4B-finetuned_mt-nllb-en-kn",
6 max_seq_length=512,
7 dtype=torch.bfloat16,
8 load_in_4bit=False,
9)
10FastLanguageModel.for_inference(model)
11
12messages = [
13 {
14 "role": "system",
15 "content": "You are a helpful assistant. Translate the given English text to Kannada. Output only the Kannada translation, nothing else.",
16 },
17 {"role": "user", "content": "Translate to Kannada: Please intercede for us all and especially at the hour of our death, Amen."},
18]
19
20prompt = tokenizer.apply_chat_template(
21 messages,
22 tokenize=False,
23 add_generation_prompt=True,
24 enable_thinking=False,
25)
26
27inputs = tokenizer(text=[prompt], return_tensors="pt").to(model.device)
28outputs = model.generate(**inputs, max_new_tokens=128, do_sample=False)
29decoded = tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
30print(decoded.strip())Qwen/Qwen3.5-4Bbfloat16NVIDIA H100 NVLpavan-naik/mt-nllb-en-kn16,702 train / 4,017 validationQwen/Qwen3.5-4B base model.16160.0128128225652e-40.0510 / 100 / 1000.41300.5300 at step 2000.55464660.39s (~1h 17m 40s)17.9190.0714,017 examples.| Model | chrF2 |
|---|---|
Zero-shot Qwen/Qwen3.5-4B | 45.66 |
Zero-shot Qwen/Qwen3.5-9B | 51.45 |
Fine-tuned Qwen/Qwen3.5-0.8B | 48.15 |
| This LoRA fine-tuned model | 60.20 |
+14.54 chrF2+12.05 chrF2+8.75 chrF2Flash Attention 2 was active during this completed run.200, while the final saved adapter achieved the best measured translation quality in this project so far.1@software{desai2026finetuneme,
2 author = {Kshitij Desai},
3 title = {finetune-me},
4 year = {2026},
5 url = {https://github.com/kshitijdesai99/finetune-me.git}
6}