MCPcopy Index your code
hub / github.com/microsoft/BitNet / map_tensor_name

Method map_tensor_name

utils/generate-dummy-bitnet-model.py:182–186  ·  view source on GitHub ↗
(self, name: str, try_suffixes: Sequence[str] = (".weight", ".bias"))

Source from the content-addressed store, hash-verified

180 return name == (key_name + suffix)
181
182 def map_tensor_name(self, name: str, try_suffixes: Sequence[str] = (".weight", ".bias")) -> str:
183 new_name = self.tensor_map.get_name(key=name, try_suffixes=try_suffixes)
184 if new_name is None:
185 raise ValueError(f"Can not map tensor {name!r}")
186 return new_name
187
188 def set_gguf_parameters(self):
189 self.gguf_writer.add_name(self.dir_model.name)

Callers 1

modify_tensorsMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected