mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-08-06 23:15:35 +00:00
convert : fix DeepseekV4 rope parameters with transformers 5.x (#26673)
This commit is contained in:
parent
3db4ff877d
commit
eb5667a169
1 changed files with 7 additions and 0 deletions
|
|
@ -533,6 +533,13 @@ class DeepseekV4Model(TextModel):
|
|||
for key, value in raw_hparams.items():
|
||||
self.hparams.setdefault(key, value)
|
||||
|
||||
# workaround for special rope_parameters (main/compress) in transformers 5.x
|
||||
if self.rope_parameters.get("full_attention", self.rope_parameters).get("rope_type") is None:
|
||||
if (rope_scaling := raw_hparams.get("rope_scaling")) is not None:
|
||||
if "rope_type" not in rope_scaling and (rope_type := rope_scaling.get("type")) is not None:
|
||||
rope_scaling["rope_type"] = rope_type
|
||||
self.rope_parameters.update(**rope_scaling)
|
||||
|
||||
self.block_count = self.hparams["num_hidden_layers"]
|
||||
if self.mtp_only:
|
||||
self.block_count += self.hparams.get("num_nextn_predict_layers", 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue