yoshizen commited on
Commit
95ec82f
·
verified ·
1 Parent(s): b07f444

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -2
app.py CHANGED
@@ -977,9 +977,10 @@ def submit_answers(answers, api_url=DEFAULT_API_URL):
977
  try:
978
  logger.info(f"Submitting {len(answers)} answers...")
979
 
 
980
  response = requests.post(
981
  f"{api_url}/submit",
982
- json={"answers": answers}
983
  )
984
  response.raise_for_status()
985
 
@@ -989,7 +990,21 @@ def submit_answers(answers, api_url=DEFAULT_API_URL):
989
  return result
990
  except Exception as e:
991
  logger.error(f"Error submitting answers: {e}")
992
- return {"error": str(e)}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
993
 
994
  def run_full_benchmark(api_url=DEFAULT_API_URL):
995
  """Run the full benchmark process"""
 
977
  try:
978
  logger.info(f"Submitting {len(answers)} answers...")
979
 
980
+ # FIXED: Send answers directly without wrapping in {"answers": ...}
981
  response = requests.post(
982
  f"{api_url}/submit",
983
+ json=answers # Send the answers list directly
984
  )
985
  response.raise_for_status()
986
 
 
990
  return result
991
  except Exception as e:
992
  logger.error(f"Error submitting answers: {e}")
993
+ # Include more detailed error information
994
+ error_details = {
995
+ "error": str(e),
996
+ "traceback": traceback.format_exc()
997
+ }
998
+
999
+ # If it's a response error, try to get more details
1000
+ if hasattr(e, 'response') and e.response is not None:
1001
+ try:
1002
+ error_details["status_code"] = e.response.status_code
1003
+ error_details["response_text"] = e.response.text
1004
+ except:
1005
+ pass
1006
+
1007
+ return error_details
1008
 
1009
  def run_full_benchmark(api_url=DEFAULT_API_URL):
1010
  """Run the full benchmark process"""