Skip to content

Commit ff2d1ca

Browse files
author
Han Wang
committed
refactor(pt_expt): remove dead fallback in _load_model_params
model_def_script.json is always present in .pte/.pt2 archives, so the fallback to {"type_map": ...} is unreachable.
1 parent 5e90b19 commit ff2d1ca

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

deepmd/pt_expt/utils/finetune.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@ def _load_model_params(finetune_model: str) -> dict[str, Any]:
3333
)
3434

3535
data = serialize_from_file(finetune_model)
36-
# Prefer embedded model_def_script (full training config); fall back to
37-
# a minimal dict with just type_map for older .pte files.
38-
if "model_def_script" in data:
39-
return data["model_def_script"]
40-
return {"type_map": data["model"]["type_map"]}
36+
return data["model_def_script"]
4137
else:
4238
state_dict = torch.load(finetune_model, map_location=DEVICE, weights_only=True)
4339
if "model" in state_dict:

0 commit comments

Comments
 (0)