Spaces:
Sleeping
Sleeping
add timeout
Browse files
app.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import os
|
| 2 |
import tempfile
|
|
|
|
| 3 |
|
| 4 |
import gradio as gr
|
| 5 |
import pandas as pd
|
|
@@ -93,6 +94,8 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
| 93 |
submitted_answer = agent.run(question_text, file_path)
|
| 94 |
answers_payload.append(AnswerData(task_id=task_id, answer=submitted_answer))
|
| 95 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|
|
|
|
|
|
|
| 96 |
except Exception as e:
|
| 97 |
print(f"Error running agent on task {task_id}: {e}")
|
| 98 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": f"AGENT ERROR: {e}"})
|
|
|
|
| 1 |
import os
|
| 2 |
import tempfile
|
| 3 |
+
import time
|
| 4 |
|
| 5 |
import gradio as gr
|
| 6 |
import pandas as pd
|
|
|
|
| 94 |
submitted_answer = agent.run(question_text, file_path)
|
| 95 |
answers_payload.append(AnswerData(task_id=task_id, answer=submitted_answer))
|
| 96 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|
| 97 |
+
|
| 98 |
+
time.sleep(40) # to not exceed free limits
|
| 99 |
except Exception as e:
|
| 100 |
print(f"Error running agent on task {task_id}: {e}")
|
| 101 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": f"AGENT ERROR: {e}"})
|