Spaces:
Paused
Paused
Return file path instead of PIL Image for grounding visualization
Browse files
app.py
CHANGED
|
@@ -66,7 +66,6 @@ agent = Agent(
|
|
| 66 |
print(f"Tools loaded: {len(tools)}")
|
| 67 |
|
| 68 |
import glob
|
| 69 |
-
from PIL import Image
|
| 70 |
|
| 71 |
def chat(message, history):
|
| 72 |
config = {"configurable": {"thread_id": "default"}}
|
|
@@ -95,10 +94,9 @@ def chat(message, history):
|
|
| 95 |
# Get the most recent visualization
|
| 96 |
viz_files.sort(key=os.path.getmtime, reverse=True)
|
| 97 |
latest_viz = viz_files[0]
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
pass
|
| 102 |
|
| 103 |
return assistant_message, viz_image
|
| 104 |
|
|
|
|
| 66 |
print(f"Tools loaded: {len(tools)}")
|
| 67 |
|
| 68 |
import glob
|
|
|
|
| 69 |
|
| 70 |
def chat(message, history):
|
| 71 |
config = {"configurable": {"thread_id": "default"}}
|
|
|
|
| 94 |
# Get the most recent visualization
|
| 95 |
viz_files.sort(key=os.path.getmtime, reverse=True)
|
| 96 |
latest_viz = viz_files[0]
|
| 97 |
+
# Return the file path directly - Gradio can handle it
|
| 98 |
+
if os.path.exists(latest_viz):
|
| 99 |
+
viz_image = latest_viz
|
|
|
|
| 100 |
|
| 101 |
return assistant_message, viz_image
|
| 102 |
|