Text Generation
Transformers
Safetensors
Urdu
qwen2
urdu
poetry
conversational
text-generation-inference
How to use from
SGLang
Install from pip and serve model
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
    --model-path "Khurram123/Qwen2.5-3B-Urdu-Ultimate-Poet" \
    --host 0.0.0.0 \
    --port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
	-H "Content-Type: application/json" \
	--data '{
		"model": "Khurram123/Qwen2.5-3B-Urdu-Ultimate-Poet",
		"messages": [
			{
				"role": "user",
				"content": "What is the capital of France?"
			}
		]
	}'
Use Docker images
docker run --gpus all \
    --shm-size 32g \
    -p 30000:30000 \
    -v ~/.cache/huggingface:/root/.cache/huggingface \
    --env "HF_TOKEN=<secret>" \
    --ipc=host \
    lmsysorg/sglang:latest \
    python3 -m sglang.launch_server \
        --model-path "Khurram123/Qwen2.5-3B-Urdu-Ultimate-Poet" \
        --host 0.0.0.0 \
        --port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
	-H "Content-Type: application/json" \
	--data '{
		"model": "Khurram123/Qwen2.5-3B-Urdu-Ultimate-Poet",
		"messages": [
			{
				"role": "user",
				"content": "What is the capital of France?"
			}
		]
	}'
Quick Links

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:

  1. News & Information: Trained on the XL-Sum dataset to provide accurate and concise summaries of complex Urdu news articles.
  2. Instruction & Chat: Integrated with Urdu-Alpaca data to follow user commands, answer questions, and engage in natural conversation.
  3. 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))
Downloads last month
2
Safetensors
Model size
3B params
Tensor type
F16
·
Inference Providers NEW
Input a message to start chatting with Khurram123/Qwen2.5-3B-Urdu-Ultimate-Poet.

Model tree for Khurram123/Qwen2.5-3B-Urdu-Ultimate-Poet

Base model

Qwen/Qwen2.5-3B
Finetuned
(417)
this model
Quantizations
1 model

Datasets used to train Khurram123/Qwen2.5-3B-Urdu-Ultimate-Poet