Text Generation
Transformers
Safetensors
PyTorch
English
Chinese
qwen2
qwen2.5
onnx-conversion-ready
conversational
text-generation-inference
Instructions to use marcusmi4n/qwen2.5-0.5b-conversion-ready with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use marcusmi4n/qwen2.5-0.5b-conversion-ready with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="marcusmi4n/qwen2.5-0.5b-conversion-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-0.5b-conversion-ready") model = AutoModelForCausalLM.from_pretrained("marcusmi4n/qwen2.5-0.5b-conversion-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-0.5b-conversion-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-0.5b-conversion-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-0.5b-conversion-ready", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/marcusmi4n/qwen2.5-0.5b-conversion-ready
- SGLang
How to use marcusmi4n/qwen2.5-0.5b-conversion-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-0.5b-conversion-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-0.5b-conversion-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-0.5b-conversion-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-0.5b-conversion-ready", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use marcusmi4n/qwen2.5-0.5b-conversion-ready with Docker Model Runner:
docker model run hf.co/marcusmi4n/qwen2.5-0.5b-conversion-ready
Qwen 2.5 0.5B - Conversion Ready
This repository contains a Qwen 2.5 0.5B model prepared for ONNX conversion and QNN deployment.
Model Details
- Base Model: Qwen/Qwen2.5-0.5B
- Architecture: Qwen2ForCausalLM
- Parameters: ~0.5B
- Hidden Size: 896
- Layers: 24
- Vocabulary Size: 151936
- Max Position: 32768
Features
- ✅ PyTorch Model: Ready to use with transformers
- ✅ Conversion Scripts: Includes ONNX conversion utilities
- ✅ QNN Ready: Optimized for Qualcomm Neural Network SDK
- ✅ Documentation: Complete conversion pipeline docs
Usage
Basic Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("marcusmi4n/qwen2.5-0.5b-conversion-ready")
tokenizer = AutoTokenizer.from_pretrained("marcusmi4n/qwen2.5-0.5b-conversion-ready")
# Generate text
inputs = tokenizer("Hello, I am", return_tensors="pt")
outputs = model.generate(**inputs, max_length=50)
print(tokenizer.decode(outputs[0]))
ONNX Conversion
# Use the included conversion script
python convert_to_onnx.py --model-path marcusmi4n/qwen2.5-0.5b-conversion-ready --output-path model.onnx
Known Issues
- Direct ONNX export may face challenges due to modern attention mechanisms
- Recommend using the included conversion scripts for best results
- For QNN deployment, consider the full pipeline in the repository
Files Included
pytorch_model.bin/model.safetensors- Model weightsconfig.json- Model configurationtokenizer.json- Tokenizerconvert_to_onnx.py- ONNX conversion scriptREADME.md- This documentationconversion_report.md- Detailed conversion analysis
License
Apache 2.0 - Same as base Qwen 2.5 model
Citation
@misc{qwen25-conversion-ready,
title={Qwen 2.5 0.5B - Conversion Ready},
author={QNN Conversion Pipeline},
year={2025},
url={https://huggingface.co/marcusmi4n/qwen2.5-0.5b-conversion-ready}
}
Base Model Citation
Please cite the original Qwen 2.5 paper and model:
@article{qwen2.5,
title={Qwen2.5: A Party of Foundation Models},
author={Qwen Team},
journal={arXiv preprint},
year={2024}
}
- Downloads last month
- 3
Model tree for marcusmi4n/qwen2.5-0.5b-conversion-ready
Base model
Qwen/Qwen2.5-0.5B