Update app.py
Browse files
app.py
CHANGED
@@ -167,10 +167,16 @@ def generate_object_history(object_name):
|
|
167 |
print(f"Generating {time_period} frame: {prompt}")
|
168 |
#result = agent.run(prompt)
|
169 |
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
images.append(result.to_raw())
|
175 |
image_filename = f"{object_name}_{time_period}.png"
|
176 |
plot_and_save_agent_image(result, labels[time_period], save_path=image_filename)
|
|
|
167 |
print(f"Generating {time_period} frame: {prompt}")
|
168 |
#result = agent.run(prompt)
|
169 |
|
170 |
+
try:
|
171 |
+
result = agent.run(
|
172 |
+
general_instruction,
|
173 |
+
additional_args={"user_prompt": prompt}
|
174 |
+
)
|
175 |
+
image = result.to_raw()
|
176 |
+
except Exception as e:
|
177 |
+
print(f"Agent failed on {time_period}: {e}")
|
178 |
+
continue
|
179 |
+
|
180 |
images.append(result.to_raw())
|
181 |
image_filename = f"{object_name}_{time_period}.png"
|
182 |
plot_and_save_agent_image(result, labels[time_period], save_path=image_filename)
|