wahibtim commited on
Commit
33d74bd
·
verified ·
1 Parent(s): c48b9d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -96,7 +96,7 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
96
  and displays the results.
97
  """
98
  if not profile:
99
- return "Please Login to Hugging Face with the button.", None
100
 
101
  username = profile.username.strip()
102
  print(f"👤 User logged in: {username}")
@@ -130,7 +130,7 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
130
  results_log = []
131
  answers_payload = []
132
 
133
- print(f"🚀 Running agent on {len(questions_data)} questions... (this may take a while)")
134
 
135
  for item in questions_data:
136
  task_id = item.get("task_id")
@@ -174,4 +174,7 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
174
  f"Message: {result_data.get('message', 'No message')}"
175
  )
176
 
177
- return final
 
 
 
 
96
  and displays the results.
97
  """
98
  if not profile:
99
+ return "Please Login to Hugging Face with the button.", None
100
 
101
  username = profile.username.strip()
102
  print(f"👤 User logged in: {username}")
 
130
  results_log = []
131
  answers_payload = []
132
 
133
+ print(f"🚀 Running agent on {len(questions_data)} questions... (this may take 5-15 minutes)")
134
 
135
  for item in questions_data:
136
  task_id = item.get("task_id")
 
174
  f"Message: {result_data.get('message', 'No message')}"
175
  )
176
 
177
+ return final_status, pd.DataFrame(results_log)
178
+
179
+ except Exception as e:
180
+ return f"❌ Submission Failed: {str(e)}", pd.DataFrame(results_log)