Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 20, 2024
1 parent 041152d commit e2547e5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions deepmd/pt/entrypoints/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down Expand Up @@ -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

Check warning on line 330 in deepmd/pt/entrypoints/main.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/entrypoints/main.py#L325-L330

Added lines #L325 - L330 were not covered by tests
# 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, (

Check warning on line 332 in deepmd/pt/entrypoints/main.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/entrypoints/main.py#L332

Added line #L332 was not covered by tests
"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}")

Check warning on line 337 in deepmd/pt/entrypoints/main.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/entrypoints/main.py#L336-L337

Added lines #L336 - L337 were not covered by tests
else:
Expand Down

0 comments on commit e2547e5

Please sign in to comment.