Spaces:
Sleeping
Sleeping
chore: lazy clean UI text and code
Browse files
app.py
CHANGED
@@ -144,30 +144,16 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
144 |
return status_message, results_df
|
145 |
|
146 |
|
147 |
-
#
|
148 |
with gr.Blocks() as demo:
|
149 |
gr.Markdown("# Basic Agent Evaluation Runner")
|
150 |
-
|
151 |
-
"""
|
152 |
-
**Instructions:**
|
153 |
-
|
154 |
-
1. Please clone this space, then modify the code to define your agent's logic, the tools, the necessary packages, etc ...
|
155 |
-
2. Log in to your Hugging Face account using the button below. This uses your HF username for submission.
|
156 |
-
3. Click 'Run Evaluation & Submit All Answers' to fetch questions, run your agent, submit answers, and see the score.
|
157 |
-
|
158 |
-
---
|
159 |
-
**Disclaimers:**
|
160 |
-
Once clicking on the "submit button, it can take quite some time ( this is the time for the agent to go through all the questions).
|
161 |
-
This space provides a basic setup and is intentionally sub-optimal to encourage you to develop your own, more robust solution. For instance for the delay process of the submit button, a solution could be to cache the answers and submit in a seperate action or even to answer the questions in async.
|
162 |
-
"""
|
163 |
-
)
|
164 |
-
|
165 |
gr.LoginButton()
|
166 |
|
167 |
run_button = gr.Button("Run Evaluation & Submit All Answers")
|
168 |
|
169 |
status_output = gr.Textbox(label="Run Status / Submission Result", lines=5, interactive=False)
|
170 |
-
|
171 |
results_table = gr.DataFrame(label="Questions and Agent Answers", wrap=True)
|
172 |
|
173 |
run_button.click(
|
@@ -177,9 +163,9 @@ with gr.Blocks() as demo:
|
|
177 |
|
178 |
if __name__ == "__main__":
|
179 |
print("\n" + "-"*30 + " App Starting " + "-"*30)
|
180 |
-
|
181 |
space_host_startup = os.getenv("SPACE_HOST")
|
182 |
-
space_id_startup = os.getenv("SPACE_ID")
|
183 |
|
184 |
if space_host_startup:
|
185 |
print(f"✅ SPACE_HOST found: {space_host_startup}")
|
@@ -187,7 +173,7 @@ if __name__ == "__main__":
|
|
187 |
else:
|
188 |
print("ℹ️ SPACE_HOST environment variable not found (running locally?).")
|
189 |
|
190 |
-
if space_id_startup:
|
191 |
print(f"✅ SPACE_ID found: {space_id_startup}")
|
192 |
print(f" Repo URL: https://huggingface.co/spaces/{space_id_startup}")
|
193 |
print(f" Repo Tree URL: https://huggingface.co/spaces/{space_id_startup}/tree/main")
|
|
|
144 |
return status_message, results_df
|
145 |
|
146 |
|
147 |
+
# Gradio App
|
148 |
with gr.Blocks() as demo:
|
149 |
gr.Markdown("# Basic Agent Evaluation Runner")
|
150 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
gr.LoginButton()
|
152 |
|
153 |
run_button = gr.Button("Run Evaluation & Submit All Answers")
|
154 |
|
155 |
status_output = gr.Textbox(label="Run Status / Submission Result", lines=5, interactive=False)
|
156 |
+
|
157 |
results_table = gr.DataFrame(label="Questions and Agent Answers", wrap=True)
|
158 |
|
159 |
run_button.click(
|
|
|
163 |
|
164 |
if __name__ == "__main__":
|
165 |
print("\n" + "-"*30 + " App Starting " + "-"*30)
|
166 |
+
|
167 |
space_host_startup = os.getenv("SPACE_HOST")
|
168 |
+
space_id_startup = os.getenv("SPACE_ID")
|
169 |
|
170 |
if space_host_startup:
|
171 |
print(f"✅ SPACE_HOST found: {space_host_startup}")
|
|
|
173 |
else:
|
174 |
print("ℹ️ SPACE_HOST environment variable not found (running locally?).")
|
175 |
|
176 |
+
if space_id_startup:
|
177 |
print(f"✅ SPACE_ID found: {space_id_startup}")
|
178 |
print(f" Repo URL: https://huggingface.co/spaces/{space_id_startup}")
|
179 |
print(f" Repo Tree URL: https://huggingface.co/spaces/{space_id_startup}/tree/main")
|