Skip to content

Commit

Permalink
Merge branch '3742' of github.com:Chengqian-Zhang/deepmd-kit into 3742
Browse files Browse the repository at this point in the history
  • Loading branch information
Chengqian-Zhang committed May 20, 2024
2 parents be6b71c + 09d2fec commit 065cc2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deepmd/pt/entrypoints/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,14 +315,14 @@ def main(args: Optional[Union[List[str], argparse.Namespace]] = None):
if FLAGS.list_model_branch:
assert (
FLAGS.finetune is not None
), "When using --list-model-branch, please use --finetune"
), "Error: The '--list-model-branch' option requires the '--finetune' argument to specify the model."
state_dict = torch.load(FLAGS.finetune, map_location=env.DEVICE)
if "model" in state_dict:
state_dict = state_dict["model"]
model_params = state_dict["_extra_state"]["model_params"]
finetune_from_multi_task = "model_dict" in model_params
# Pretrained model must be multitask mode
assert finetune_from_multi_task, "When using --list-model-branch, the pretrained model must be multitask model"
assert finetune_from_multi_task, "Error: The '--list-model-branch' option requires a multitask pretrained model. The provided model does not meet this criterion."
model_branch = list(model_params["model_dict"].keys())
log.info(f"Available model branches are {model_branch}")
else:
Expand Down

0 comments on commit 065cc2d

Please sign in to comment.