Upload folder using huggingface_hub
Browse files- README.md +16 -35
- comparison_graph.png +0 -0
- model-00001-of-00002.safetensors +1 -1
- model-00002-of-00002.safetensors +1 -1
- tokenizer.json +1 -1
README.md
CHANGED
|
@@ -5,7 +5,6 @@ tags:
|
|
| 5 |
- python
|
| 6 |
- optimized
|
| 7 |
- wanda
|
| 8 |
-
- activation-pruning
|
| 9 |
base_model: Qwen/Qwen2.5-3B-Instruct
|
| 10 |
pipeline_tag: text-generation
|
| 11 |
---
|
|
@@ -14,35 +13,28 @@ pipeline_tag: text-generation
|
|
| 14 |
|
| 15 |
> π― **PYTHON-optimized** | π¦ **Safe** pruning | β‘ **1% weights pruned**
|
| 16 |
|
| 17 |
-
This model is a **conservatively pruned** version of [Qwen/Qwen2.5-3B-Instruct](https://huggingface.co/Qwen/Qwen2.5-3B-Instruct)
|
| 18 |
|
| 19 |
-
##
|
| 20 |
-
|
| 21 |
-
- **Specialization**: Optimized for Python tasks
|
| 22 |
-
- **Pruning Method**: Wanda-style (|W| Γ |activation|) importance scoring
|
| 23 |
-
- **Size Reduction**: 1% weights pruned
|
| 24 |
-
- **Use Case**: High accuracy retention, ideal for production use
|
| 25 |
-
|
| 26 |
-
## π Performance Comparison
|
| 27 |
|
| 28 |
| Category | Original | Pruned | Change |
|
| 29 |
|----------|----------|--------|--------|
|
| 30 |
-
| **Python** |
|
| 31 |
-
| Html |
|
| 32 |
-
| Trivia |
|
| 33 |
-
| Math |
|
| 34 |
-
| Reasoning |
|
| 35 |
-
| Medical |
|
| 36 |
-
| Linux |
|
| 37 |
-
| Writing |
|
| 38 |
|
| 39 |
-
**Average**:
|
| 40 |
|
| 41 |
-
**Python Retention**: 100.0%
|
| 42 |
|
| 43 |

|
| 44 |
|
| 45 |
-
##
|
| 46 |
|
| 47 |
```python
|
| 48 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
@@ -50,31 +42,20 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
| 50 |
model = AutoModelForCausalLM.from_pretrained("CompactAI/Qwen2.5-3B-Instruct-python-safe")
|
| 51 |
tokenizer = AutoTokenizer.from_pretrained("CompactAI/Qwen2.5-3B-Instruct-python-safe")
|
| 52 |
|
| 53 |
-
# Example usage
|
| 54 |
inputs = tokenizer("Your prompt here", return_tensors="pt")
|
| 55 |
outputs = model.generate(**inputs, max_new_tokens=100)
|
| 56 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 57 |
```
|
| 58 |
|
| 59 |
-
##
|
| 60 |
|
| 61 |
| Property | Value |
|
| 62 |
|----------|-------|
|
| 63 |
| Base Model | [Qwen/Qwen2.5-3B-Instruct](https://huggingface.co/Qwen/Qwen2.5-3B-Instruct) |
|
| 64 |
| Specialization | Python |
|
| 65 |
| Prune Mode | Safe |
|
| 66 |
-
| Pruning Method | Activation-based weight pruning (Wanda) |
|
| 67 |
| Weight Reduction | 1% weights pruned |
|
| 68 |
|
| 69 |
-
##
|
| 70 |
-
|
| 71 |
-
This model is part of the **Qwen2.5-3B-Instruct** pruned model collection. Variants:
|
| 72 |
-
- **Safe** - Conservative pruning (~10-20%), high accuracy retention
|
| 73 |
-
- **Aggressive** - Maximum compression (~40-50%), best for edge deployment
|
| 74 |
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
This model inherits the license from the base model [Qwen/Qwen2.5-3B-Instruct](https://huggingface.co/Qwen/Qwen2.5-3B-Instruct).
|
| 78 |
-
|
| 79 |
-
---
|
| 80 |
-
*Generated by ZANNPS [Zeto Automatic Neural Network Pruning System]*
|
|
|
|
| 5 |
- python
|
| 6 |
- optimized
|
| 7 |
- wanda
|
|
|
|
| 8 |
base_model: Qwen/Qwen2.5-3B-Instruct
|
| 9 |
pipeline_tag: text-generation
|
| 10 |
---
|
|
|
|
| 13 |
|
| 14 |
> π― **PYTHON-optimized** | π¦ **Safe** pruning | β‘ **1% weights pruned**
|
| 15 |
|
| 16 |
+
This model is a **conservatively pruned** version of [Qwen/Qwen2.5-3B-Instruct](https://huggingface.co/Qwen/Qwen2.5-3B-Instruct).
|
| 17 |
|
| 18 |
+
## Performance Comparison
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
| Category | Original | Pruned | Change |
|
| 21 |
|----------|----------|--------|--------|
|
| 22 |
+
| **Python** | 92.3% | 92.3% β | β |
|
| 23 |
+
| Html | 40.0% | 40.0% | β |
|
| 24 |
+
| Trivia | 100.0% | 100.0% | β |
|
| 25 |
+
| Math | 100.0% | 100.0% | β |
|
| 26 |
+
| Reasoning | 91.7% | 91.7% | β |
|
| 27 |
+
| Medical | 64.3% | 64.3% | β |
|
| 28 |
+
| Linux | 69.2% | 69.2% | β |
|
| 29 |
+
| Writing | 54.5% | 54.5% | β |
|
| 30 |
|
| 31 |
+
**Average**: 76.5% β 76.5% (+0.0%)
|
| 32 |
|
| 33 |
+
**Python Retention**: 100.0%
|
| 34 |
|
| 35 |

|
| 36 |
|
| 37 |
+
## Quick Start
|
| 38 |
|
| 39 |
```python
|
| 40 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
|
| 42 |
model = AutoModelForCausalLM.from_pretrained("CompactAI/Qwen2.5-3B-Instruct-python-safe")
|
| 43 |
tokenizer = AutoTokenizer.from_pretrained("CompactAI/Qwen2.5-3B-Instruct-python-safe")
|
| 44 |
|
|
|
|
| 45 |
inputs = tokenizer("Your prompt here", return_tensors="pt")
|
| 46 |
outputs = model.generate(**inputs, max_new_tokens=100)
|
| 47 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 48 |
```
|
| 49 |
|
| 50 |
+
## Technical Details
|
| 51 |
|
| 52 |
| Property | Value |
|
| 53 |
|----------|-------|
|
| 54 |
| Base Model | [Qwen/Qwen2.5-3B-Instruct](https://huggingface.co/Qwen/Qwen2.5-3B-Instruct) |
|
| 55 |
| Specialization | Python |
|
| 56 |
| Prune Mode | Safe |
|
|
|
|
| 57 |
| Weight Reduction | 1% weights pruned |
|
| 58 |
|
| 59 |
+
## License
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
+
This model inherits the license from the base model.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
comparison_graph.png
CHANGED
|
|
model-00001-of-00002.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 3995916600
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c3ede79e8ebee2c46c136dacacad35481dd742eb95aef761b98f535c3e155c5a
|
| 3 |
size 3995916600
|
model-00002-of-00002.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 2176009944
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6f0b7b954afd6db4f60f9c3cf3d65145d04b588f533f2d33c200edb503e93e1f
|
| 3 |
size 2176009944
|
tokenizer.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 11422159
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7b3e3adf18710ac3bd97b384b0d01b58205c4c5cd37c6c56d24c8fff86b0561d
|
| 3 |
size 11422159
|