convert : fix conversion for llama 4 (#13567)

This commit is contained in:
Xuan-Son Nguyen 2025-05-15 17:40:07 +02:00 committed by GitHub
parent 02cdd2d8b0
commit c531edfa34
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 33 additions and 30 deletions

View file

@ -2069,6 +2069,9 @@ class Llama4Model(LlamaModel):
self.gguf_writer.add_expert_feed_forward_length(self.hparams["intermediate_size_moe"])
def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None):
if name.startswith("language_model."):
name = name.replace("language_model.", "")
# split the gate_up into gate and up
if "gate_up_proj" in name:
name_up = name.replace("gate_up_proj", "up_proj.weight")