Spaces:
Sleeping
Sleeping
saifisvibinn commited on
Commit ·
d6af317
1
Parent(s): 95c340e
Fix PermissionError: Use temp dir for image logs
Browse files- app/validator.py +2 -1
app/validator.py
CHANGED
|
@@ -1260,7 +1260,8 @@ RESPOND WITH JSON ONLY - NO ADDITIONAL TEXT OR MARKDOWN.
|
|
| 1260 |
# --- START NEW IMAGE LOGGING SETUP ---
|
| 1261 |
# Create persistent log directory for troubleshooting
|
| 1262 |
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S_%f")[:-3] # Remove last 3 digits of microseconds
|
| 1263 |
-
|
|
|
|
| 1264 |
|
| 1265 |
# Create the persistent log folder
|
| 1266 |
os.makedirs(log_dir_name, exist_ok=True)
|
|
|
|
| 1260 |
# --- START NEW IMAGE LOGGING SETUP ---
|
| 1261 |
# Create persistent log directory for troubleshooting
|
| 1262 |
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S_%f")[:-3] # Remove last 3 digits of microseconds
|
| 1263 |
+
# Use temp directory for logs to avoid PermissionError in read-only environments
|
| 1264 |
+
log_dir_name = os.path.join(tempfile.gettempdir(), "extracted_images_log", timestamp)
|
| 1265 |
|
| 1266 |
# Create the persistent log folder
|
| 1267 |
os.makedirs(log_dir_name, exist_ok=True)
|