Skip to content

Commit c61a5a8

Browse files
Merge pull request google-ai-edge#687 from gudgud96:fix/export-directory
PiperOrigin-RevId: 764814512
2 parents aa4e088 + 311c536 commit c61a5a8

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)