Skip to content

Commit

Permalink
Change assert info
Browse files Browse the repository at this point in the history
  • Loading branch information
Chengqian-Zhang committed May 20, 2024
1 parent 84a5f1d commit 041152d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions deepmd/pt/entrypoints/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
from deepmd.pt.utils.dataloader import (
DpLoaderSet,
)
from deepmd.pt.utils import (
env,
)
from deepmd.pt.utils.env import (
DEVICE,
)
Expand Down Expand Up @@ -326,10 +329,9 @@ def main(args: Optional[Union[List[str], argparse.Namespace]] = None):
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
), "Error: The '--list-model-branch' option requires \
a multitask pretrained model. The provided model does not meet this criterion"
assert finetune_from_multi_task, \
f"The '--list-model-branch' option requires a multitask pretrained model."\
f" 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 041152d

Please sign in to comment.