Skip to content

Commit b19ecae

Browse files
committed
yarn scaling
1 parent 0fd3930 commit b19ecae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

convert_hf_to_gguf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6471,9 +6471,9 @@ def set_gguf_parameters(self):
64716471
# Rope
64726472
rope_scaling = self.hparams.get("rope_scaling", {})
64736473
if rope_scaling.get("type") == "dynamic":
6474-
logger.warning("Model uses 'dynamic' rope scaling, which is not yet supported in GGUF. "
6475-
"Long-context extrapolation will not work correctly. Setting rope scaling type to NONE.")
6476-
self.gguf_writer.add_rope_scaling_type(gguf.RopeScalingType.NONE)
6474+
self.gguf_writer.add_rope_scaling_type(gguf.RopeScalingType.YARN)
6475+
self.gguf_writer.add_rope_scaling_factor(rope_scaling["factor"])
6476+
self.gguf_writer.add_rope_scaling_orig_ctx_len(self.hparams["max_position_embeddings"])
64776477

64786478
_experts: list[dict[str, Tensor]] | None = None
64796479

0 commit comments

Comments
 (0)