Upload configuration_pruned_flex_olmo.py with huggingface_hub
Browse files
configuration_pruned_flex_olmo.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Configuration for pruned FlexOlmo models with variable-width expert 1."""
|
| 2 |
+
|
| 3 |
+
from transformers import FlexOlmoConfig
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
class PrunedFlexOlmoConfig(FlexOlmoConfig):
|
| 7 |
+
"""Config for FlexOlmo with a pruned expert 1.
|
| 8 |
+
|
| 9 |
+
Extends FlexOlmoConfig with expert_1_intermediate_size to specify
|
| 10 |
+
the width of the pruned expert.
|
| 11 |
+
"""
|
| 12 |
+
|
| 13 |
+
model_type = "pruned_flex_olmo"
|
| 14 |
+
|
| 15 |
+
def __init__(self, expert_1_intermediate_size: int = None, **kwargs):
|
| 16 |
+
super().__init__(**kwargs)
|
| 17 |
+
# expert_1_intermediate_size: width of pruned expert 1
|
| 18 |
+
# If None, falls back to intermediate_size (no pruning)
|
| 19 |
+
self.expert_1_intermediate_size = expert_1_intermediate_size or self.intermediate_size
|