diff --git a/deepmd/pt/model/model/__init__.py b/deepmd/pt/model/model/__init__.py index 30ef20d0e1..1675215d7b 100644 --- a/deepmd/pt/model/model/__init__.py +++ b/deepmd/pt/model/model/__init__.py @@ -59,7 +59,7 @@ def get_spin_model(model_params): model_params = copy.deepcopy(model_params) - if model_params["spin"]["use_spin"] and isinstance( + if not model_params["spin"]["use_spin"] or isinstance( model_params["spin"]["use_spin"][0], int ): use_spin = np.full(len(model_params["type_map"]), False)