| # Qwen2 with 1.5B ONNX INT8 β Mobile-Optimized Quantized Model |
|
|
| ## π Description |
| This is a quantized INT8 version of the Qwen language model, |
| converted to ONNX format for efficient inference on low-resource |
| devices such as mobile phones and edge hardware. |
|
|
| ## π― Objective |
| The goal of this project is to make Qwen accessible on devices |
| with limited memory and compute power (e.g. iPhone 12, mid-range |
| Android phones) without requiring high-end GPUs or cloud infrastructure. |
|
|
| ## β‘ Key Features |
| - **Format**: ONNX (INT8 quantized) |
| - **Size**: Reduced ~4x compared to FP32 original |
| - **Target hardware**: CPU-only devices, mobile, edge |
| - **Inference engine**: ONNX Runtime (`onnxruntime`) |
|
|
| ## π οΈ Usage |
|
|
| ### Install dependencies |
| pip install onnxruntime numpy |
|
|
| ### Run inference |
| import onnxruntime as ort |
|
|
| session = ort.InferenceSession( |
| "model_int8.onnx", |
| providers=["CPUExecutionProvider"] |
| ) |
| |
| ## π Files |
| | File | Description | |
| |---|---| |
| | `model.onnx` | Original FP32 model | |
| | `model_int8.onnx` | INT8 quantized model β
| |
| | `tokenizer.json` | Tokenizer config | |
| | `vocab.json` | Vocabulary | |
| | `quantize_int8.py` | Quantization script | |
|
|
|  |
|
|