Spaces:
Sleeping
Sleeping
David Kovář
commited on
Commit
·
a816645
1
Parent(s):
ded8dc7
multiple questions
Browse files
app.py
CHANGED
|
@@ -1,4 +1,6 @@
|
|
| 1 |
import os
|
|
|
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
import requests
|
| 4 |
import inspect
|
|
@@ -26,7 +28,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 26 |
return "Please Login to Hugging Face with the button.", None
|
| 27 |
|
| 28 |
api_url = DEFAULT_API_URL
|
| 29 |
-
questions_url = f"{api_url}/
|
| 30 |
submit_url = f"{api_url}/submit"
|
| 31 |
|
| 32 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
|
@@ -63,8 +65,9 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 63 |
# 3. Run your Agent
|
| 64 |
results_log = []
|
| 65 |
answers_payload = []
|
| 66 |
-
|
| 67 |
-
|
|
|
|
| 68 |
task_id = item.get("task_id")
|
| 69 |
question_text = item.get("question")
|
| 70 |
if not task_id or question_text is None:
|
|
|
|
| 1 |
import os
|
| 2 |
+
import random
|
| 3 |
+
|
| 4 |
import gradio as gr
|
| 5 |
import requests
|
| 6 |
import inspect
|
|
|
|
| 28 |
return "Please Login to Hugging Face with the button.", None
|
| 29 |
|
| 30 |
api_url = DEFAULT_API_URL
|
| 31 |
+
questions_url = f"{api_url}/questions"
|
| 32 |
submit_url = f"{api_url}/submit"
|
| 33 |
|
| 34 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
|
|
|
| 65 |
# 3. Run your Agent
|
| 66 |
results_log = []
|
| 67 |
answers_payload = []
|
| 68 |
+
question_subset = random.sample(questions_data, 2)
|
| 69 |
+
print(f"Running agent on {len(question_subset)} questions...")
|
| 70 |
+
for item in question_subset:
|
| 71 |
task_id = item.get("task_id")
|
| 72 |
question_text = item.get("question")
|
| 73 |
if not task_id or question_text is None:
|