AMfeta99 commited on
Commit
6d50a88
·
verified ·
1 Parent(s): 8349a8f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -4
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
- result = agent.run(
171
- general_instruction,
172
- additional_args={"user_prompt": prompt}
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)