MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / load

Method load

convert.py:302–317  ·  view source on GitHub ↗
(model_plus: ModelPlus)

Source from the content-addressed store, hash-verified

300
301 @staticmethod
302 def load(model_plus: ModelPlus) -> Params:
303 hf_config_path = model_plus.paths[0].parent / "config.json"
304 orig_config_path = model_plus.paths[0].parent / "params.json"
305
306 if hf_config_path.exists():
307 params = Params.loadHFTransformerJson(model_plus.model, hf_config_path)
308 elif orig_config_path.exists():
309 params = Params.loadOriginalParamsJson(model_plus.model, orig_config_path)
310 elif model_plus.format != 'none':
311 params = Params.guessed(model_plus.model)
312 else:
313 raise ValueError('Cannot guess params when model format is none')
314
315 params.path_model = model_plus.paths[0].parent
316
317 return params
318
319
320#

Callers 15

run_with_preset.pyFile · 0.45
loadPredictorJsonMethod · 0.45
loadHFTransformerJsonMethod · 0.45
__init__Method · 0.45
__init__Method · 0.45
load_unquantizedFunction · 0.45
loadFunction · 0.45
loadMethod · 0.45
do_itemMethod · 0.45
mainFunction · 0.45
solve_gpu_splitFunction · 0.45

Calls 3

loadHFTransformerJsonMethod · 0.45
guessedMethod · 0.45

Tested by

no test coverage detected