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

Method load

convert-dense.py:281–296  ·  view source on GitHub ↗
(model_plus: ModelPlus)

Source from the content-addressed store, hash-verified

279
280 @staticmethod
281 def load(model_plus: ModelPlus) -> Params:
282 hf_config_path = model_plus.paths[0].parent / "config.json"
283 orig_config_path = model_plus.paths[0].parent / "params.json"
284
285 if hf_config_path.exists():
286 params = Params.loadHFTransformerJson(model_plus.model, hf_config_path)
287 elif orig_config_path.exists():
288 params = Params.loadOriginalParamsJson(model_plus.model, orig_config_path)
289 elif model_plus.format != 'none':
290 params = Params.guessed(model_plus.model)
291 else:
292 raise ValueError('Cannot guess params when model format is none')
293
294 params.path_model = model_plus.paths[0].parent
295
296 return params
297
298
299#

Callers 9

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

Calls 3

loadHFTransformerJsonMethod · 0.45
guessedMethod · 0.45

Tested by

no test coverage detected