Downloads · 30 days
6
9% of all-time downloads
hbfreed/flex-general-2048
flex-general-2048 is a text generation model from hbfreed. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
A pruned and partially distilled variant of allenai/Flex-math-2x7B-1T with a variable-width expert MLP. Expert 1 has been pruned from the full 11,008 intermediate size down to 2048 (19% of original width), then partia…
Downloads · 30 days
6
9% of all-time downloads
All-time downloads
66
Public
Parameters
8.1B
405 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors16.2 GB · 83%
From the Hugging Face model README
A pruned and partially distilled variant of allenai/Flex-math-2x7B-1T with a variable-width expert MLP. Expert 1 has been pruned from the full 11,008 intermediate size down to 2048 (19% of original width), then partially recovered via knowledge distillation.
Unlike the math-calibrated variant, this model's pruning was calibrated on general-purpose data — meaning importance scores were computed on a broad data mix rather than math-specific data. 58% of the top-2048 most important neurons differ between the two calibration approaches.
| Total Parameters | 8.1B |
| Expert 1 Parameters | 0.8B |
| Expert 1 Width | 2048 (19%) |
| Base Model | allenai/Flex-math-2x7B-1T (11.6B params) |
| Distillation | Partial (~20k steps, stopped early) |
For full details, see the blog post.
This repo includes a modeling_pruned_flex_olmo.py file that handles the variable-width expert architecture. Just load with trust_remote_code=True and it works like any other HuggingFace model:
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("hbfreed/flex-general-2048", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("allenai/Flex-math-2x7B-1T")
inputs = tokenizer("Hello, world!", return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
The tokenizer is the same as the base model's.
| Model | Calibration | Expert Width | Distillation |
|---|---|---|---|
| flex-math-8192 | Math | 8192 (74%) | Full |
| flex-math-5504 | Math | 5504 (50%) | Full |
| flex-math-2048 | Math | 2048 (19%) | Full |
| flex-general-2048 | General | 2048 (19%) | Partial |
Apache 2.0 (same as base model)