Skip to content

Commit

Permalink
Cover corner case for role_scaling not in config.json
Browse files Browse the repository at this point in the history
  • Loading branch information
suhara committed Aug 14, 2024
1 parent e4bb91b commit 0645adc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion convert_hf_to_gguf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3759,7 +3759,7 @@ def set_gguf_parameters(self):
self.gguf_writer.add_rope_dimension_count(int(rot_pct * n_embd) // n_head)

# * RopeScaling for Nemotron
if self.hparams["rope_scaling"] is None:
if "rope_scaling" not in self.hparams or self.hparams["rope_scaling"] is None:
self.gguf_writer.add_rope_scaling_type(gguf.RopeScalingType.NONE)
else:
self.gguf_writer.add_rope_scaling_type(gguf.RopeScalingType.LINEAR)
Expand Down

0 comments on commit 0645adc

Please sign in to comment.