CompactAI's picture
Upload folder using huggingface_hub
065bfec verified
---
license: apache-2.0
tags:
- pruned
- python
- optimized
- wanda
- activation-pruning
base_model: Qwen/Qwen2.5-3B-Instruct
pipeline_tag: text-generation
---
# Qwen2.5-3B-Instruct-python-safe
> 🎯 **PYTHON-optimized** | πŸ“¦ **Safe** pruning | ⚑ **1% weights pruned**
This model is a **conservatively pruned** version of [Qwen/Qwen2.5-3B-Instruct](https://huggingface.co/Qwen/Qwen2.5-3B-Instruct), specialized for **PYTHON** tasks using activation-aware weight pruning (Wanda-style).
## ✨ Key Features
- **Specialization**: Optimized for Python tasks
- **Pruning Method**: Wanda-style (|W| Γ— |activation|) importance scoring
- **Size Reduction**: 1% weights pruned
- **Use Case**: High accuracy retention, ideal for production use
## πŸ“Š Performance Comparison
| Category | Original | Pruned | Change |
|----------|----------|--------|--------|
| **Python** | 100.0% | 100.0% ⭐ | β†’ |
| Html | 6.7% | 6.7% | β†’ |
| Trivia | 66.7% | 66.7% | β†’ |
| Math | 60.0% | 60.0% | β†’ |
| Reasoning | 100.0% | 100.0% | β†’ |
| Medical | 86.7% | 86.7% | β†’ |
| Linux | 100.0% | 100.0% | β†’ |
| Writing | 73.3% | 73.3% | β†’ |
**Average**: 74.2% β†’ 74.2% (+0.0%)
**Python Retention**: 100.0% of original performance
![Comparison Graph](comparison_graph.png)
## πŸš€ Quick Start
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("CompactAI/Qwen2.5-3B-Instruct-python-safe")
tokenizer = AutoTokenizer.from_pretrained("CompactAI/Qwen2.5-3B-Instruct-python-safe")
# Example usage
inputs = tokenizer("Your prompt here", return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=100)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```
## πŸ“‹ Technical Details
| Property | Value |
|----------|-------|
| Base Model | [Qwen/Qwen2.5-3B-Instruct](https://huggingface.co/Qwen/Qwen2.5-3B-Instruct) |
| Specialization | Python |
| Prune Mode | Safe |
| Pruning Method | Activation-based weight pruning (Wanda) |
| Weight Reduction | 1% weights pruned |
## πŸ”— Related Models
This model is part of the **Qwen2.5-3B-Instruct** pruned model collection. Variants:
- **Safe** - Conservative pruning (~10-20%), high accuracy retention
- **Aggressive** - Maximum compression (~40-50%), best for edge deployment
## πŸ“œ License
This model inherits the license from the base model [Qwen/Qwen2.5-3B-Instruct](https://huggingface.co/Qwen/Qwen2.5-3B-Instruct).
---
*Generated by ZANNPS [Zeto Automatic Neural Network Pruning System]*