Views
No views yet
| Category | Examples |
|---|---|
| Translation (Urdu → English) | 105 |
| Grammar Correction | 100 |
| Question Answering | 100 |
| Text Summarization | 107 |
| Text Completion | 91 |
| Formal/Informal Conversion | 75 |
| Total | 578 |
| Parameter | Value |
|---|---|
| Base Model | Phi-3-mini-4k-instruct (4-bit) |
| Fine-tuning Method | LoRA (r=16, alpha=16) |
| Training Epochs | 3 |
| Learning Rate | 2e-4 |
| Training Loss | 1.37 → 0.47 |
| Framework | Unsloth + TRL |
| Hardware | Google Colab T4 GPU |
1from unsloth import FastLanguageModel
2
3model, tokenizer = FastLanguageModel.from_pretrained(
4 model_name = "Almanships/Phi3-UrduInstruct",
5 max_seq_length = 2048,
6 dtype = None,
7 load_in_4bit = True,
8)
9
10FastLanguageModel.for_inference(model)
11
12messages = [
13 {"role": "user", "content":
14 "اس جملے کا انگریزی میں ترجمہ کریں\nپاکستان ایک خوبصورت ملک ہے"}
15]
16
17inputs = tokenizer.apply_chat_template(
18 messages,
19 tokenize=True,
20 add_generation_prompt=True,
21 return_tensors="pt"
22).to("cuda")
23
24outputs = model.generate(input_ids=inputs, max_new_tokens=128)
25print(tokenizer.decode(outputs[0], skip_special_tokens=True))پاکستان ایک خوبصورت ملک ہےPakistan is a beautiful countryوہ گیا بازار آجوہ آج بازار گیاپاکستان کا دارالحکومت کون سا ہے؟پاکستان کا دارالحکومت اسلام آباد ہے@misc{phi3-urduinstruct-2026,
author = {Almanships},
title = {Phi3-UrduInstruct: Instruction Tuning of
Phi-3 for Urdu Language},
year = {2026},
publisher = {HuggingFace},
url = {https://huggingface.co/Almanships/Phi3-UrduInstruct}
}