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:

  1. ๐Ÿ”— Vร o LuvU4ever/qwen2.5-3b-qlora-merged-v3
  2. ๐Ÿš€ Click Deploy โ†’ Inference Endpoints
  3. โš™๏ธ Chแปn GPU [small] instance
  4. โœ… 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
Safetensors
Model size
3B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for LuvU4ever/qwen2.5-3b-qlora-merged-v3

Base model

Qwen/Qwen2.5-3B
Finetuned
(741)
this model