Text Generation
Transformers
Safetensors
English
Chinese
Vietnamese
qwen2
qwen2.5
instruct
unsloth
vietnamese
inference-ready
production-ready
conversational
text-generation-inference
Instructions to use LuvU4ever/qwen2.5-3b-qlora-merged-v3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LuvU4ever/qwen2.5-3b-qlora-merged-v3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LuvU4ever/qwen2.5-3b-qlora-merged-v3") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("LuvU4ever/qwen2.5-3b-qlora-merged-v3") model = AutoModelForCausalLM.from_pretrained("LuvU4ever/qwen2.5-3b-qlora-merged-v3", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use LuvU4ever/qwen2.5-3b-qlora-merged-v3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LuvU4ever/qwen2.5-3b-qlora-merged-v3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LuvU4ever/qwen2.5-3b-qlora-merged-v3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LuvU4ever/qwen2.5-3b-qlora-merged-v3
- SGLang
How to use LuvU4ever/qwen2.5-3b-qlora-merged-v3 with 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 "LuvU4ever/qwen2.5-3b-qlora-merged-v3" \ --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": "LuvU4ever/qwen2.5-3b-qlora-merged-v3", "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 "LuvU4ever/qwen2.5-3b-qlora-merged-v3" \ --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": "LuvU4ever/qwen2.5-3b-qlora-merged-v3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Desktop
- Docker Model Runner
How to use LuvU4ever/qwen2.5-3b-qlora-merged-v3 with Docker Model Runner:
docker model run hf.co/LuvU4ever/qwen2.5-3b-qlora-merged-v3
Qwen-2.5 3B Instruct - Production Ready
๐ Verified working vแปi Hugging Face Inference Endpoints!
ฤรขy lร copy cแปงa unsloth/Qwen2.5-3B-Instruct ฤฦฐแปฃc optimize cho production deployment. Model nร y ฤรฃ ฤฦฐแปฃc test vร verified hoแบกt ฤแปng hoร n hแบฃo vแปi HF Inference Endpoints.
โจ ฤแบทc ฤiแปm
- โ Inference Endpoints Ready: Verified hoแบกt ฤแปng 100% vแปi HF Inference Endpoints
- โ No Quantization Issues: Khรดng cรณ vแบฅn ฤแป quantization vแปi TGI
- โ Production Optimized: Sแบตn sร ng cho production environment
- โ Vietnamese Excellence: Hแป trแปฃ tiแบฟng Viแปt xuแบฅt sแบฏc
- โ Multi-language: Hแป trแปฃ 29+ ngรดn ngแปฏ
- โ High Performance: 3B parameters vแปi hiแปu suแบฅt cao
๐ Quick Deploy
1-Click Deploy trรชn Inference Endpoints:
- ๐ Vร o LuvU4ever/qwen2.5-3b-qlora-merged-v3
- ๐ Click Deploy โ Inference Endpoints
- โ๏ธ Chแปn GPU [small] instance
- โ Click Create Endpoint
๐ป Cรกch sแปญ dแปฅng
Local Inference
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load model
model = AutoModelForCausalLM.from_pretrained(
"LuvU4ever/qwen2.5-3b-qlora-merged-v3",
torch_dtype="auto",
device_map="auto",
trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained("LuvU4ever/qwen2.5-3b-qlora-merged-v3")
# Chat vแปi model
messages = [
{"role": "user", "content": "Xin chร o! Bแบกn cรณ thแป giรบp tรดi gรฌ?"}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
inputs = tokenizer([text], return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=512,
temperature=0.7,
do_sample=True,
pad_token_id=tokenizer.eos_token_id
)
response = tokenizer.decode(outputs[0][len(inputs["input_ids"][0]):], skip_special_tokens=True)
print(response)
API Usage (Inference Endpoints)
import requests
import json
# Cแบฅu hรฌnh API
API_URL = "YOUR_ENDPOINT_URL" # Lแบฅy tแปซ Inference Endpoints
headers = {
"Authorization": "Bearer YOUR_HF_TOKEN",
"Content-Type": "application/json"
}
def chat_with_model(message, max_tokens=200):
payload = {
"inputs": f"<|im_start|>user\n{message}<|im_end|>\n<|im_start|>assistant\n",
"parameters": {
"max_new_tokens": max_tokens,
"temperature": 0.7,
"do_sample": True,
"stop": ["<|im_end|>"],
"return_full_text": False
}
}
response = requests.post(API_URL, headers=headers, json=payload)
if response.status_code == 200:
result = response.json()
return result[0]["generated_text"].strip()
else:
return f"Error: {response.status_code} - {response.text}"
# Sแปญ dแปฅng
response = chat_with_model("Viแปt Nam cรณ nhแปฏng mรณn ฤn truyแปn thแปng nร o?")
print(response)
Batch Processing
def batch_chat(messages_list):
results = []
for msg in messages_list:
response = chat_with_model(msg)
results.append({"question": msg, "answer": response})
return results
# Example
questions = [
"Hร Nแปi cรณ gรฌ ฤแบทc biแปt?",
"Cรกch nแบฅu phแป bรฒ?",
"Lแปch sแปญ Viแปt Nam cรณ gรฌ thรบ vแป?"
]
results = batch_chat(questions)
for item in results:
print(f"Q: {item['question']}")
print(f"A: {item['answer']}\n")
๐ Specifications
| Spec | Value |
|---|---|
| Model Size | ~3B parameters |
| Architecture | Qwen2.5 |
| Context Length | 32,768 tokens |
| Languages | 29+ languages |
| Deployment | โ HF Inference Endpoints |
| Format | Safetensors |
| License | Apache 2.0 |
๐ฏ Use Cases
- ๐ฌ Chatbots: Customer service, virtual assistants
- ๐ Content Generation: Blog posts, articles, creative writing
- ๐ Q&A Systems: Knowledge bases, FAQ automation
- ๐ Multi-language: Translation vร cross-language tasks
- ๐ผ Business: Report generation, email drafting
- ๐ Education: Tutoring, explanation generation
๐ง Chat Format
Model sแปญ dแปฅng Qwen chat template:
<|im_start|>user
Your question here
<|im_end|>
<|im_start|>assistant
AI response here
<|im_end|>
โ ๏ธ Important Notes
- Model hoแบกt ฤแปng tแปt nhแบฅt vแปi temperature 0.7-0.8
- Sแปญ dแปฅng stop tokens
["<|im_end|>"]ฤแป trรกnh over-generation - Vแปi cรขu hแปi tiแบฟng Viแปt, model cho kแบฟt quแบฃ rแบฅt tแปฑ nhiรชn
- Verified compatibility vแปi TGI container
๐ Performance
- โ Inference Endpoints: Tested and verified working
- โก Speed: ~20-50 tokens/second on GPU small
- ๐ฏ Accuracy: Excellent cho Vietnamese vร English
- ๐พ Memory: ~6GB VRAM for inference
๐ Support
- ๐ Issues: Report tแบกi GitHub issues
- ๐ Docs: Xem Qwen2.5 documentation
- ๐ฌ Community: HuggingFace discussions
๐ Ready for production deployment!
- Downloads last month
- 5