Skip to content

Commit c20c1bf

Browse files
committed
Add helpful logs
1 parent 84e7bd4 commit c20c1bf

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

optimum/executorch/modeling.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,16 @@ def __del__(self):
120120
"""Clean up temporary files when the model instance is destroyed."""
121121
self._cleanup_temp_resources()
122122

123+
import psutil
124+
125+
for part in psutil.disk_partitions():
126+
usage = psutil.disk_usage(part.mountpoint)
127+
print(f"{part.device} mounted on {part.mountpoint}")
128+
print(f" Total: {usage.total / 2**30:.2f} GB")
129+
print(f" Used: {usage.used / 2**30:.2f} GB")
130+
print(f" Free: {usage.free / 2**30:.2f} GB")
131+
print(f" Percent Used: {usage.percent}%\n")
132+
123133
def _cleanup_temp_resources(self):
124134
"""Clean up temporary directory and files."""
125135
if hasattr(self, "_temp_dir") and self._temp_dir is not None:

0 commit comments

Comments
 (0)