convert float for yarn related arguments in rope_scaling (#37139)

* convert float for yarn related arguments in rope_scaling

* sort keys alphabetically

---------

Co-authored-by: ryan.agile <ryan.agile@kakaobrain.com>
This commit is contained in:
Minho Ryu 2025-04-08 20:58:22 +09:00 committed by GitHub
parent 2515a5a290
commit 0fc683d1cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -233,6 +233,12 @@ class DeepseekV3Config(PretrainedConfig):
# BC: if there is a 'type' field, copy it it to 'rope_type'. # BC: if there is a 'type' field, copy it it to 'rope_type'.
if self.rope_scaling is not None and "type" in self.rope_scaling: if self.rope_scaling is not None and "type" in self.rope_scaling:
self.rope_scaling["rope_type"] = self.rope_scaling["type"] self.rope_scaling["rope_type"] = self.rope_scaling["type"]
if self.rope_scaling is not None:
for key in ["beta_fast", "beta_slow", "factor"]:
if key in self.rope_scaling:
self.rope_scaling[key] = float(self.rope_scaling[key])
rope_config_validation(self) rope_config_validation(self)
super().__init__( super().__init__(