Sborole commited on
Commit
5494379
·
verified ·
1 Parent(s): 142415b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -133,17 +133,17 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
133
  continue
134
  try:
135
  if file_content:
136
- submitted_answer = agent(question_text, file_content=file_content, file_path=file_path)
137
  else:
138
- submitted_answer = agent(question_text)
139
 
140
- if not submitted_answer:
141
- submitted_answer = "I am unable to answer"
142
- answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
143
- results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
144
  except Exception as e:
145
  print(f"Error running agent on task {task_id}: {e}")
146
- results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": f"AGENT ERROR: {e}"})
147
 
148
  if not answers_payload:
149
  print("Agent did not produce any answers to submit.")
 
133
  continue
134
  try:
135
  if file_content:
136
+ answer = agent(question_text, file_content=file_content, file_path=file_path)
137
  else:
138
+ answer = agent(question_text)
139
 
140
+ if not answer:
141
+ answer = "I am unable to answer"
142
+ answers_payload.append({"task_id": task_id, "answer": answer})
143
+ results_log.append({"Task ID": task_id, "Question": question_text, "Answer": answer})
144
  except Exception as e:
145
  print(f"Error running agent on task {task_id}: {e}")
146
+ results_log.append({"Task ID": task_id, "Question": question_text, "Answer": f"AGENT ERROR: {e}"})
147
 
148
  if not answers_payload:
149
  print("Agent did not produce any answers to submit.")