File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -1992,6 +1992,14 @@ def set_vocab(self):
1992
1992
except FileNotFoundError :
1993
1993
self ._set_vocab_gpt2 ()
1994
1994
1995
+ def set_gguf_parameters (self ):
1996
+ super ().set_gguf_parameters ()
1997
+ if self .hparams .get ("rope_scaling" ) is not None and "factor" in self .hparams ["rope_scaling" ]:
1998
+ if self .hparams ["rope_scaling" ].get ("type" ) == "yarn" :
1999
+ self .gguf_writer .add_rope_scaling_type (gguf .RopeScalingType .YARN )
2000
+ self .gguf_writer .add_rope_scaling_factor (self .hparams ["rope_scaling" ]["factor" ])
2001
+ self .gguf_writer .add_rope_scaling_orig_ctx_len (self .hparams ["rope_scaling" ]["original_max_position_embeddings" ])
2002
+
1995
2003
1996
2004
@Model .register ("Qwen2MoeForCausalLM" )
1997
2005
class Qwen2MoeModel (Model ):
Original file line number Diff line number Diff line change @@ -761,6 +761,7 @@ class MODEL_TENSOR(IntEnum):
761
761
MODEL_TENSOR .TOKEN_EMBD ,
762
762
MODEL_TENSOR .OUTPUT_NORM ,
763
763
MODEL_TENSOR .OUTPUT ,
764
+ MODEL_TENSOR .ROPE_FREQS ,
764
765
MODEL_TENSOR .ATTN_NORM ,
765
766
MODEL_TENSOR .ATTN_Q ,
766
767
MODEL_TENSOR .ATTN_K ,
You can’t perform that action at this time.
0 commit comments