Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -20,4 +20,18 @@ tags:
|
|
| 20 |
|
| 21 |
## Reproduction
|
| 22 |
|
|
|
|
|
|
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
## Reproduction
|
| 22 |
|
| 23 |
+
```python
|
| 24 |
+
from compressed_tensors.entrypoints.convert import convert_checkpoint, MagnitudeExpertPruner
|
| 25 |
|
| 26 |
+
convert_checkpoint(
|
| 27 |
+
model_stub="Qwen/Qwen3.8-Flash-Next",
|
| 28 |
+
save_directory="Qwen3.8-Flash-Next-MEP50",
|
| 29 |
+
converter=MagnitudeExpertPruner.from_pretrained(
|
| 30 |
+
"Qwen/Qwen3.8-Flash-Next",
|
| 31 |
+
router_pattern=r"language_model\.layers\.\d+\.mlp\.gate\.weight$",
|
| 32 |
+
expert_pattern=r"language_model\.layers\.\d+\.mlp\.experts\.(gate_up_proj|down_proj)$",
|
| 33 |
+
sparsity=0.5,
|
| 34 |
+
),
|
| 35 |
+
max_workers=8,
|
| 36 |
+
)
|
| 37 |
+
```
|