MCPcopy Create free account
hub / github.com/Pints-AI/1.5-Pints / load

Method load

tokenizer/convert/convert.py:315–330  ·  view source on GitHub ↗
(model_plus: ModelPlus)

Source from the content-addressed store, hash-verified

313
314 @staticmethod
315 def load(model_plus: ModelPlus) -> Params:
316 hf_config_path = model_plus.paths[0].parent / "config.json"
317 orig_config_path = model_plus.paths[0].parent / "params.json"
318
319 if hf_config_path.exists():
320 params = Params.loadHFTransformerJson(model_plus.model, hf_config_path)
321 elif orig_config_path.exists():
322 params = Params.loadOriginalParamsJson(model_plus.model, orig_config_path)
323 elif model_plus.format != 'none':
324 params = Params.guessed(model_plus.model)
325 else:
326 raise ValueError('Cannot guess params when model format is none')
327
328 params.path_model = model_plus.paths[0].parent
329
330 return params
331
332
333#

Callers 15

eval.pyFile · 0.45
mainFunction · 0.45
convert_hf_checkpointFunction · 0.45
convert_fileFunction · 0.45
convert_multiFunction · 0.45
__init__Method · 0.45
load_weightsFunction · 0.45
__init__Method · 0.45
mainFunction · 0.45
loadHFTransformerJsonMethod · 0.45

Calls 3

loadHFTransformerJsonMethod · 0.80
guessedMethod · 0.80

Tested by

no test coverage detected