From 3b230c2cceea40db3b03a017c063e4c7a78bbb6a Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Sun, 14 Apr 2024 19:10:08 -0400 Subject: [PATCH] fix(pt): fix model_def_script In the current code, model_def_script is modified, causing incompatibility with other backends. --- deepmd/pt/model/model/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deepmd/pt/model/model/__init__.py b/deepmd/pt/model/model/__init__.py index 1675215d7b..b813a06eb6 100644 --- a/deepmd/pt/model/model/__init__.py +++ b/deepmd/pt/model/model/__init__.py @@ -138,6 +138,7 @@ def get_zbl_model(model_params): def get_standard_model(model_params): + model_params_old = model_params model_params = copy.deepcopy(model_params) ntypes = len(model_params["type_map"]) # descriptor @@ -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) return model