Skip to content

Commit

Permalink
fix(pt): fix model_def_script
Browse files Browse the repository at this point in the history
In the current code, model_def_script is modified, causing incompatibility with other backends.
  • Loading branch information
njzjz committed Apr 14, 2024
1 parent 3eb3d51 commit 3b230c2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion deepmd/pt/model/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def get_zbl_model(model_params):


def get_standard_model(model_params):
model_params_old = model_params

Check warning on line 141 in deepmd/pt/model/model/__init__.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/model/model/__init__.py#L141

Added line #L141 was not covered by tests
model_params = copy.deepcopy(model_params)
ntypes = len(model_params["type_map"])
# descriptor
Expand Down Expand Up @@ -167,7 +168,7 @@ def get_standard_model(model_params):
atom_exclude_types=atom_exclude_types,
pair_exclude_types=pair_exclude_types,
)
model.model_def_script = json.dumps(model_params)
model.model_def_script = json.dumps(model_params_old)

Check warning on line 171 in deepmd/pt/model/model/__init__.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/model/model/__init__.py#L171

Added line #L171 was not covered by tests
return model


Expand Down

0 comments on commit 3b230c2

Please sign in to comment.