Skip to content

Commit

Permalink
fix(conversion): Simplify tensor name mapping in conversion
Browse files Browse the repository at this point in the history
Branch: GraniteMoE

Co-Authored-By: [email protected]
Signed-off-by: Gabe Goodhart <[email protected]>
  • Loading branch information
gabe-l-hart committed Sep 23, 2024
1 parent e68431b commit 1349625
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions convert_hf_to_gguf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4129,8 +4129,8 @@ def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iter
if name.endswith("block_sparse_moe.input_linear.weight"):
gate, up = data_torch.chunk(2, dim=-2)
return [
(self.map_tensor_name(f"model.layers.{bid}.block_sparse_moe.input_linear.gate.weight"), gate),
(self.map_tensor_name(f"model.layers.{bid}.block_sparse_moe.input_linear.up.weight"), up),
(self.format_tensor_name(gguf.MODEL_TENSOR.FFN_GATE_EXP, bid), gate),
(self.format_tensor_name(gguf.MODEL_TENSOR.FFN_UP_EXP, bid), up),
]

return super().modify_tensors(data_torch, name, bid)
Expand Down

0 comments on commit 1349625

Please sign in to comment.