Skip to content

Commit 074cf76

Browse files
committed
[fix] fix export to path without directory
1 parent ed3a9cc commit 074cf76

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ai_edge_torch/model.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ def export(self, path: str) -> None:
155155
Args:
156156
path: The path to file to which the model is serialized.
157157
"""
158-
os.makedirs(os.path.dirname(path), exist_ok=True)
158+
if os.path.dirname(path) != '':
159+
os.makedirs(os.path.dirname(path), exist_ok=True)
159160
with open(path, 'wb') as file_handle:
160161
file_handle.write(self._tflite_model)
161162

0 commit comments

Comments
 (0)