Text Generation
Transformers
Safetensors
PyTorch
English
Chinese
qwen2
qwen2.5
multilingual
conversational
text-generation-inference
Instructions to use marcusmi4n/qwen2.5-3b-qnn-ready with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use marcusmi4n/qwen2.5-3b-qnn-ready with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="marcusmi4n/qwen2.5-3b-qnn-ready") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("marcusmi4n/qwen2.5-3b-qnn-ready") model = AutoModelForCausalLM.from_pretrained("marcusmi4n/qwen2.5-3b-qnn-ready") 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 marcusmi4n/qwen2.5-3b-qnn-ready with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "marcusmi4n/qwen2.5-3b-qnn-ready" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "marcusmi4n/qwen2.5-3b-qnn-ready", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/marcusmi4n/qwen2.5-3b-qnn-ready
- SGLang
How to use marcusmi4n/qwen2.5-3b-qnn-ready 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 "marcusmi4n/qwen2.5-3b-qnn-ready" \ --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": "marcusmi4n/qwen2.5-3b-qnn-ready", "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 "marcusmi4n/qwen2.5-3b-qnn-ready" \ --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": "marcusmi4n/qwen2.5-3b-qnn-ready", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use marcusmi4n/qwen2.5-3b-qnn-ready with Docker Model Runner:
docker model run hf.co/marcusmi4n/qwen2.5-3b-qnn-ready
Qwen 2.5 3B - QNN Ready
This repository contains the Qwen 2.5 3B model prepared for QNN deployment.
Model Details
- Base Model: Qwen/Qwen2.5-3B
- Architecture: Qwen2ForCausalLM
- Parameters: ~3B
- Languages: English, Chinese, and others
- Format: PyTorch (Safetensors)
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("marcusmi4n/qwen2.5-3b-qnn-ready")
tokenizer = AutoTokenizer.from_pretrained("marcusmi4n/qwen2.5-3b-qnn-ready")
# Generate text
inputs = tokenizer("Hello, I am", return_tensors="pt")
outputs = model.generate(**inputs, max_length=50)
print(tokenizer.decode(outputs[0]))
QNN Conversion
This model can be converted to QNN format using the scripts in this repository:
# Quantize the model
python scripts/simple_quantize_abeja.py --model-path marcusmi4n/qwen2.5-3b-qnn-ready
# Convert to ONNX
python scripts/create_mock_onnx.py --model-path marcusmi4n/qwen2.5-3b-qnn-ready
# Compile for QNN
python scripts/mock_qnn_compile.py --model-path marcusmi4n/qwen2.5-3b-qnn-ready
License
Apache 2.0
Citation
@misc{qwen25-3b-qnn-ready,
title={Qwen 2.5 3B - QNN Ready},
author={QNN Conversion Pipeline},
year={2025},
url={https://huggingface.co/marcusmi4n/qwen2.5-3b-qnn-ready}
}
- Downloads last month
- 8
Model tree for marcusmi4n/qwen2.5-3b-qnn-ready
Base model
Qwen/Qwen2.5-3B