Spaces:
Sleeping
Sleeping
Commit
·
44f5f1d
1
Parent(s):
7439ea8
Updated images temp folder properly
Browse files
app.py
CHANGED
@@ -170,7 +170,7 @@ async def chat(request: ChatRequest):
|
|
170 |
image_url = None
|
171 |
if result.get('visual_image'):
|
172 |
# Get the most recent image from the directory
|
173 |
-
images_dir = "generated_images"
|
174 |
if os.path.exists(images_dir):
|
175 |
image_files = [f for f in os.listdir(images_dir) if f.endswith('.png')]
|
176 |
if image_files:
|
@@ -300,7 +300,7 @@ async def clear_history():
|
|
300 |
@app.get("/images/list")
|
301 |
async def list_images():
|
302 |
try:
|
303 |
-
images_dir = "generated_images"
|
304 |
if not os.path.exists(images_dir):
|
305 |
return {"images": []}
|
306 |
|
|
|
170 |
image_url = None
|
171 |
if result.get('visual_image'):
|
172 |
# Get the most recent image from the directory
|
173 |
+
images_dir = "/tmp/generated_images"
|
174 |
if os.path.exists(images_dir):
|
175 |
image_files = [f for f in os.listdir(images_dir) if f.endswith('.png')]
|
176 |
if image_files:
|
|
|
300 |
@app.get("/images/list")
|
301 |
async def list_images():
|
302 |
try:
|
303 |
+
images_dir = "/tmp/generated_images"
|
304 |
if not os.path.exists(images_dir):
|
305 |
return {"images": []}
|
306 |
|