GattoNero commited on
Commit
a3fad52
·
verified ·
1 Parent(s): 1445ce8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -72,7 +72,7 @@ class BasicAgent:
72
  '''
73
 
74
 
75
- def __call__(self, question: str) -> str:
76
  print_coso(f"Received question: {question[:100]}")
77
 
78
  # Prova a decodificare JSON
@@ -252,7 +252,8 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
252
  print(f"Skipping item with missing task_id or question: {item}")
253
  continue
254
  try:
255
- submitted_answer = agent(question_text)
 
256
  answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
257
  results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
258
  except Exception as e:
@@ -273,7 +274,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
273
  try:
274
 
275
 
276
- '''
277
  response = requests.post(submit_url, json=submission_data, timeout=60)
278
  response.raise_for_status()
279
  result_data = response.json()
@@ -289,8 +290,8 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
289
 
290
  print(f"coso final_status: {final_status} - results_df: {results_df}")
291
  return final_status, results_df
292
- '''
293
- return "mock1", None
294
 
295
 
296
  except requests.exceptions.HTTPError as e:
 
72
  '''
73
 
74
 
75
+ def __call__(self, question: str, file_name: str = "") -> str:
76
  print_coso(f"Received question: {question[:100]}")
77
 
78
  # Prova a decodificare JSON
 
252
  print(f"Skipping item with missing task_id or question: {item}")
253
  continue
254
  try:
255
+ file_name = item.get("file_name")
256
+ submitted_answer = agent(question_text, file_name)
257
  answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
258
  results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
259
  except Exception as e:
 
274
  try:
275
 
276
 
277
+
278
  response = requests.post(submit_url, json=submission_data, timeout=60)
279
  response.raise_for_status()
280
  result_data = response.json()
 
290
 
291
  print(f"coso final_status: {final_status} - results_df: {results_df}")
292
  return final_status, results_df
293
+
294
+ #return "mock1", None
295
 
296
 
297
  except requests.exceptions.HTTPError as e: