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

Method load

utils/convert-ms-to-gguf-bitnet.py:372–387  ·  view source on GitHub ↗
(model_plus: ModelPlus)

Source from the content-addressed store, hash-verified

370
371 @staticmethod
372 def load(model_plus: ModelPlus) -> Params:
373 hf_config_path = model_plus.paths[0].parent / "config.json"
374 orig_config_path = model_plus.paths[0].parent / "params.json"
375
376 if hf_config_path.exists():
377 params = Params.loadHFTransformerJson(model_plus.model, hf_config_path)
378 elif orig_config_path.exists():
379 params = Params.loadOriginalParamsJson(model_plus.model, orig_config_path)
380 elif model_plus.format != 'none':
381 params = Params.guessed(model_plus.model)
382 else:
383 raise ValueError('Cannot guess params when model format is none')
384
385 params.path_model = model_plus.paths[0].parent
386
387 return params
388
389
390#

Callers 9

loadHFTransformerJsonMethod · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
load_unquantizedFunction · 0.45
loadFunction · 0.45
do_itemMethod · 0.45
mainFunction · 0.45

Calls 3

loadHFTransformerJsonMethod · 0.45
guessedMethod · 0.45

Tested by

no test coverage detected