From 8aa493705cce74391390f03189e0daa66b8db829 Mon Sep 17 00:00:00 2001 From: teleprint-me <77757836+teleprint-me@users.noreply.github.com> Date: Fri, 17 May 2024 03:20:14 -0400 Subject: [PATCH] feat: Make number of experts configurable Signed-off-by: teleprint-me <77757836+teleprint-me@users.noreply.github.com> --- gguf-py/gguf/tensor_mapping.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gguf-py/gguf/tensor_mapping.py b/gguf-py/gguf/tensor_mapping.py index 8e1cac915..4457fc986 100644 --- a/gguf-py/gguf/tensor_mapping.py +++ b/gguf-py/gguf/tensor_mapping.py @@ -384,7 +384,7 @@ class TensorNameMap: mapping: dict[str, tuple[MODEL_TENSOR, str]] - def __init__(self, arch: MODEL_ARCH, n_blocks: int): + def __init__(self, arch: MODEL_ARCH, n_blocks: int, n_experts: int = 60): self.mapping = {} for tensor, keys in self.mappings_cfg.items(): if tensor not in MODEL_TENSORS[arch]: @@ -398,7 +398,6 @@ class TensorNameMap: if tensor not in MODEL_TENSORS[arch]: continue # TODO: make this configurable - n_experts = 60 for xid in range(n_experts): tensor_name = TENSOR_NAMES[tensor].format(bid = bid, xid = xid) self.mapping[tensor_name] = (tensor, tensor_name)