Cover corner case for role_scaling not in config.json

This commit is contained in:
Yoshi Suhara 2024-08-13 21:25:43 -07:00
parent e4bb91b02e
commit 0645adc8b3

View file

@ -3759,7 +3759,7 @@ class NemotronModel(Model):
self.gguf_writer.add_rope_dimension_count(int(rot_pct * n_embd) // n_head) self.gguf_writer.add_rope_dimension_count(int(rot_pct * n_embd) // n_head)
# * RopeScaling for Nemotron # * 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) self.gguf_writer.add_rope_scaling_type(gguf.RopeScalingType.NONE)
else: else:
self.gguf_writer.add_rope_scaling_type(gguf.RopeScalingType.LINEAR) self.gguf_writer.add_rope_scaling_type(gguf.RopeScalingType.LINEAR)