File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,10 @@ class ModelArgs:
88
88
use_sdpa_with_kv_cache_op : bool = (
89
89
False # Use custom sdpa op that updates kv cache in-place
90
90
)
91
- rope_freq_base : float = 10000.0 # The base frequency for RoPE
91
+ rope_theta : Optional [float ] = (
92
+ None # The official name to override self.rope_freq_base.
93
+ )
94
+ rope_freq_base : float = 10000.0 # The base frequency for RoPE. Keep it for BC.
92
95
# Additional Model Metadata needed at runtime
93
96
bos_idx : int = 1
94
97
eos_idx : int = 3
@@ -99,6 +102,10 @@ def __post_init__(self):
99
102
if self .n_kv_heads is None :
100
103
self .n_kv_heads = self .n_heads
101
104
105
+ # rope_theta overrides rope_freq_base since it's the official name.
106
+ if self .rope_theta is not None :
107
+ self .rope_freq_base = self .rope_theta
108
+
102
109
if self .use_sdpa_with_kv_cache_op :
103
110
assert self .use_kv_cache , "use_sdpa_with_kv_cache_op requires use_kv_cache"
104
111
You can’t perform that action at this time.
0 commit comments