Skip to content

Commit 0ab2ba3

Browse files
author
igor
committed
AssertError -> ValueError
1 parent c6c0ec3 commit 0ab2ba3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

batchflow/models/torch/base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1709,7 +1709,10 @@ def save(self, path, format="pt", pickle_metadata=False,
17091709
Other keyword arguments, passed directly to :func:`torch.save`.
17101710
"""
17111711
available_formats = ("pt", "onnx", "openvino", "safetensors")
1712-
assert format in available_formats, f"Format must be in {available_formats}"
1712+
1713+
if format not in available_formats:
1714+
raise ValueError(f"Format must be in {available_formats}")
1715+
17131716
dirname = os.path.dirname(path)
17141717
if dirname and not os.path.exists(dirname):
17151718
os.makedirs(dirname)

0 commit comments

Comments
 (0)