diff --git a/deepmd/pt/entrypoints/main.py b/deepmd/pt/entrypoints/main.py index d12ea54479..1c768a28de 100644 --- a/deepmd/pt/entrypoints/main.py +++ b/deepmd/pt/entrypoints/main.py @@ -44,12 +44,12 @@ from deepmd.pt.train import ( training, ) -from deepmd.pt.utils.dataloader import ( - DpLoaderSet, -) from deepmd.pt.utils import ( env, ) +from deepmd.pt.utils.dataloader import ( + DpLoaderSet, +) from deepmd.pt.utils.env import ( DEVICE, ) @@ -329,9 +329,10 @@ 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, \ - f"The '--list-model-branch' option requires a multitask pretrained model."\ - f" The provided model does not meet this criterion." + assert finetune_from_multi_task, ( + "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: