Skip to content

Commit aff1e5a

Browse files
Add YaRN
1 parent 0d78f03 commit aff1e5a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

exllamav2/config.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ class ExLlamaV2Config:
111111
l3_rope_low_freq_factor: float | None
112112
l3_rope_high_freq_factor: float | None
113113
l3_rope_original_max_position_embeddings: int | None
114+
yarn_rope_factor: float | None
115+
yarn_rope_original_max_position_embeddings: int | None
114116
checkpoint_fused_mlp: bool
115117
checkpoint_offset_qzeros: bool
116118

@@ -306,6 +308,10 @@ def prepare(self, no_tensors: bool = False):
306308
self.l3_rope_low_freq_factor = rs["low_freq_factor"]
307309
self.l3_rope_high_freq_factor = rs["high_freq_factor"]
308310
self.l3_rope_original_max_position_embeddings = rs["original_max_position_embeddings"]
311+
if scaling_type == "yarn":
312+
self.alt_rope_method = "yarn"
313+
self.yarn_rope_factor = rs["factor"]
314+
self.yarn_rope_original_max_position_embeddings = rs["original_max_position_embeddings"]
309315

310316
# Checkpoint format (for GPTQ models)
311317

0 commit comments

Comments
 (0)