Qwen2.5-3B-Urdu-Ultimate-Poet
Developed by Khurram Pervez (Khurram123), this model is a high-performance, specialized version of the Qwen2.5-3B architecture, fine-tuned specifically for the nuances of the Urdu language.
🌟 Model Highlights
This "Ultimate" version is the result of a multi-stage training process designed to create a versatile Urdu AI. It excels in three distinct areas:
- News & Information: Trained on the XL-Sum dataset to provide accurate and concise summaries of complex Urdu news articles.
- Instruction & Chat: Integrated with Urdu-Alpaca data to follow user commands, answer questions, and engage in natural conversation.
- Classical & Modern Poetry: Deeply fine-tuned on the Urdu-Poetry-Dataset, allowing it to compose ghazals and nazms with an understanding of Urdu poetic rhythm and vocabulary (including styles like Firaq Gorakhpuri).
🚀 How to Use
You can load this model using the transformers library on any GPU-enabled machine.
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "Khurram123/Qwen2.5-3B-Urdu-Ultimate-Poet"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16,
device_map="auto"
)
# Example Prompt for Poetry
prompt = "<|im_start|>user\nعنوان 'شامِ ہجراں' پر ایک شعر لکھیں۔<|im_end|>\n<|im_start|>assistant\n"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=150, do_sample=True, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))