py : fix hparams parsing (if-else blocks)
ggml-ci
This commit is contained in:
parent
3fdc00f596
commit
2dac31b358
1 changed files with 5 additions and 5 deletions
10
convert.py
10
convert.py
|
@ -219,12 +219,12 @@ class Params:
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def load(model_plus: 'ModelPlus') -> 'Params':
|
def load(model_plus: 'ModelPlus') -> 'Params':
|
||||||
hf_transformer_config_path = model_plus.paths[0].parent / "config.json"
|
hf_config_path = model_plus.paths[0].parent / "config.json"
|
||||||
orig_config_path = model_plus.paths[0].parent / "params.json"
|
orig_config_path = model_plus.paths[0].parent / "params.json"
|
||||||
|
|
||||||
if hf_transformer_config_path.exists():
|
if hf_config_path.exists():
|
||||||
params = Params.loadHFTransformerJson(model_plus.model, hf_transformer_config_path)
|
params = Params.loadHFTransformerJson(model_plus.model, hf_config_path)
|
||||||
if orig_config_path.exists():
|
else if orig_config_path.exists():
|
||||||
params = Params.loadOriginalParamsJson(model_plus.model, orig_config_path)
|
params = Params.loadOriginalParamsJson(model_plus.model, orig_config_path)
|
||||||
else:
|
else:
|
||||||
params = Params.guessed(model_plus.model)
|
params = Params.guessed(model_plus.model)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue