Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ydshieh committed Oct 7, 2024
1 parent c7fd367 commit 06baf89
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/transformers/modeling_gguf_pytorch_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.

import re
from typing import Optional
from typing import Any, Dict, Optional

import numpy as np
from tqdm import tqdm
Expand Down Expand Up @@ -242,7 +242,7 @@ def reverse_reshape_bias(weights: np.ndarray, n_head: int, n_embed: int):


def split_moe_expert_tensor(
weights: np.ndarray, parsed_parameters: dict[str, dict], name: str, tensor_key_mapping: dict
weights: np.ndarray, parsed_parameters: Dict[str, Any], name: str, tensor_key_mapping: dict
):
# Original merge implementation
# https://github.com/ggerganov/llama.cpp/blob/master/convert_hf_to_gguf.py#L1994-L2022
Expand All @@ -262,4 +262,4 @@ def split_moe_expert_tensor(
for i in range(0, w_counter):
temp_name = name.replace(".weight", f".{i}.{exp_name}.weight")
exp_weight = weights[i]
parsed_parameters["tensors"][temp_name] = torch.from_numpy(np.copy(exp_weight))
parsed_parameters["tensors"][temp_name] = torch.from_numpy(np.copy(exp_weight))

0 comments on commit 06baf89

Please sign in to comment.