From 06baf892aeebd975993270e191122f0d68e401a0 Mon Sep 17 00:00:00 2001 From: ydshieh Date: Mon, 7 Oct 2024 18:52:15 +0200 Subject: [PATCH] update --- src/transformers/modeling_gguf_pytorch_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/transformers/modeling_gguf_pytorch_utils.py b/src/transformers/modeling_gguf_pytorch_utils.py index 0696413ef76030..3630f6a05f1999 100644 --- a/src/transformers/modeling_gguf_pytorch_utils.py +++ b/src/transformers/modeling_gguf_pytorch_utils.py @@ -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 @@ -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 @@ -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)) \ No newline at end of file