File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -5680,7 +5680,12 @@ def set_gguf_parameters(self):
5680
5680
rope_dim = hparams .get ("head_dim" ) or hparams ["hidden_size" ] // hparams ["num_attention_heads" ]
5681
5681
5682
5682
self .gguf_writer .add_rope_dimension_count (rope_dim )
5683
- self .gguf_writer .add_rope_scaling_type (gguf .RopeScalingType .NONE )
5683
+ if (self .hparams .get ("rope_scaling" ) or {}).get ("type" ) == "yarn" and "factor" in self .hparams ["rope_scaling" ]:
5684
+ self .gguf_writer .add_rope_scaling_type (gguf .RopeScalingType .YARN )
5685
+ self .gguf_writer .add_rope_scaling_factor (self .hparams ["rope_scaling" ]["factor" ])
5686
+ self .gguf_writer .add_rope_scaling_orig_ctx_len (self .hparams ["rope_scaling" ]["original_max_position_embeddings" ])
5687
+ else :
5688
+ self .gguf_writer .add_rope_scaling_type (gguf .RopeScalingType .NONE )
5684
5689
self .gguf_writer .add_leading_dense_block_count (hparams ["first_k_dense_replace" ])
5685
5690
self .gguf_writer .add_vocab_size (hparams ["vocab_size" ])
5686
5691
self .gguf_writer .add_expert_feed_forward_length (hparams ["moe_intermediate_size" ])
You can’t perform that action at this time.
0 commit comments