pavanmutha commited on
Commit
e482373
·
verified ·
1 Parent(s): 9023c8e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -12
app.py CHANGED
@@ -109,18 +109,20 @@ def run_agent(_):
109
  raw_insights = result.get("insights", "No insights generated.")
110
  insights = "\n".join(raw_insights) if isinstance(raw_insights, list) else raw_insights
111
  image_paths = result.get("figures", [])
112
-
113
-
114
- # Load images from paths
115
- images = []
116
- for path in image_paths:
117
- try:
118
- images.append(Image.open(path))
119
- except Exception as e:
120
- print(f"Error loading image {path}: {e}")
121
-
122
- return insights, images # ✅ Must be a 2-element tuple
123
-
 
 
124
 
125
 
126
 
 
109
  raw_insights = result.get("insights", "No insights generated.")
110
  insights = "\n".join(raw_insights) if isinstance(raw_insights, list) else raw_insights
111
  image_paths = result.get("figures", [])
112
+
113
+ print("Received image paths:", image_paths)
114
+
115
+ images = []
116
+ for path in image_paths:
117
+ try:
118
+ img = Image.open(path)
119
+ images.append(img)
120
+ except Exception as e:
121
+ print(f"Error loading image {path}: {e}")
122
+
123
+ return insights, images
124
+
125
+ return "Unexpected output format from agent.", []
126
 
127
 
128