Skip to content

Commit

Permalink
fix: fix YAML conversion
Browse files Browse the repository at this point in the history
Fix deepmodeling#4564.

Signed-off-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz committed Jan 20, 2025
1 parent a3242c4 commit e033f4f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion deepmd/dpmodel/utils/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ def save_dp_model(filename: str, model_dict: dict) -> None:
"@version": 1,
"dtype": x.dtype.name,
"value": x.tolist(),
},
}
if isinstance(x, np.ndarray)
else x,
)
with open(filename, "w") as f:
yaml.safe_dump(
Expand Down

0 comments on commit e033f4f

Please sign in to comment.