Spaces:
Running
Running
Pulastya B
commited on
Commit
·
b213e33
1
Parent(s):
5992afe
Fix session memory: preserve uploaded files for follow-up requests
Browse files- src/api/app.py +5 -7
src/api/app.py
CHANGED
|
@@ -294,13 +294,11 @@ async def run_analysis(
|
|
| 294 |
)
|
| 295 |
|
| 296 |
finally:
|
| 297 |
-
#
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
except Exception as e:
|
| 303 |
-
logger.warning(f"Failed to cleanup temp file: {e}")
|
| 304 |
|
| 305 |
|
| 306 |
@app.post("/profile")
|
|
|
|
| 294 |
)
|
| 295 |
|
| 296 |
finally:
|
| 297 |
+
# Keep temporary file for session continuity (follow-up requests)
|
| 298 |
+
# Files in /tmp are automatically cleaned up by the OS
|
| 299 |
+
# For HuggingFace Spaces: space restart clears /tmp
|
| 300 |
+
# For production: implement session-based cleanup after timeout
|
| 301 |
+
pass
|
|
|
|
|
|
|
| 302 |
|
| 303 |
|
| 304 |
@app.post("/profile")
|