Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -96,13 +96,13 @@ with gr.Blocks() as demo:
|
|
96 |
gr.Markdown(
|
97 |
"""
|
98 |
**Instructions:**
|
99 |
-
1.
|
100 |
-
2.
|
101 |
-
3.
|
102 |
---
|
103 |
**Disclaimers:**
|
104 |
-
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).
|
105 |
-
This space provides a basic setup and is intentionally sub-optimal to encourage you to develop your own, more robust solution.
|
106 |
"""
|
107 |
)
|
108 |
|
@@ -111,6 +111,7 @@ with gr.Blocks() as demo:
|
|
111 |
run_button = gr.Button("Run Evaluation & Submit All Answers")
|
112 |
|
113 |
status_output = gr.Textbox(label="Run Status / Submission Result", lines=5, interactive=False)
|
|
|
114 |
results_table = gr.DataFrame(label="Questions and Agent Answers", wrap=True)
|
115 |
|
116 |
run_button.click(
|
@@ -120,14 +121,16 @@ with gr.Blocks() as demo:
|
|
120 |
|
121 |
if __name__ == "__main__":
|
122 |
print("\n" + "-"*30 + " App Starting " + "-"*30)
|
|
|
123 |
space_host_startup = os.getenv("SPACE_HOST")
|
124 |
-
space_id_startup = os.getenv("SPACE_ID")
|
125 |
|
126 |
if space_host_startup:
|
127 |
print(f"✅ SPACE_HOST found: {space_host_startup}")
|
128 |
print(f" Runtime URL should be: https://{space_host_startup}.hf.space")
|
129 |
else:
|
130 |
print("ℹ️ SPACE_HOST environment variable not found (running locally?).")
|
|
|
131 |
if space_id_startup: # Print repo URLs if SPACE_ID is found
|
132 |
print(f"✅ SPACE_ID found: {space_id_startup}")
|
133 |
print(f" Repo URL: https://huggingface.co/spaces/{space_id_startup}")
|
@@ -138,4 +141,4 @@ if __name__ == "__main__":
|
|
138 |
print("-"*(60 + len(" App Starting ")) + "\n")
|
139 |
|
140 |
print("Launching Gradio Interface for Basic Agent Evaluation...")
|
141 |
-
demo.launch(debug=True, share=False)
|
|
|
96 |
gr.Markdown(
|
97 |
"""
|
98 |
**Instructions:**
|
99 |
+
1. Please clone this space, then modify the code to define your agent's logic, the tools, the necessary packages, etc ...
|
100 |
+
2. Log in to your Hugging Face account using the button below. This uses your HF username for submission.
|
101 |
+
3. Click 'Run Evaluation & Submit All Answers' to fetch questions, run your agent, submit answers, and see the score.
|
102 |
---
|
103 |
**Disclaimers:**
|
104 |
+
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).
|
105 |
+
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.
|
106 |
"""
|
107 |
)
|
108 |
|
|
|
111 |
run_button = gr.Button("Run Evaluation & Submit All Answers")
|
112 |
|
113 |
status_output = gr.Textbox(label="Run Status / Submission Result", lines=5, interactive=False)
|
114 |
+
# Removed max_rows=10 from DataFrame constructor
|
115 |
results_table = gr.DataFrame(label="Questions and Agent Answers", wrap=True)
|
116 |
|
117 |
run_button.click(
|
|
|
121 |
|
122 |
if __name__ == "__main__":
|
123 |
print("\n" + "-"*30 + " App Starting " + "-"*30)
|
124 |
+
# Check for SPACE_HOST and SPACE_ID at startup for information
|
125 |
space_host_startup = os.getenv("SPACE_HOST")
|
126 |
+
space_id_startup = os.getenv("SPACE_ID") # Get SPACE_ID at startup
|
127 |
|
128 |
if space_host_startup:
|
129 |
print(f"✅ SPACE_HOST found: {space_host_startup}")
|
130 |
print(f" Runtime URL should be: https://{space_host_startup}.hf.space")
|
131 |
else:
|
132 |
print("ℹ️ SPACE_HOST environment variable not found (running locally?).")
|
133 |
+
|
134 |
if space_id_startup: # Print repo URLs if SPACE_ID is found
|
135 |
print(f"✅ SPACE_ID found: {space_id_startup}")
|
136 |
print(f" Repo URL: https://huggingface.co/spaces/{space_id_startup}")
|
|
|
141 |
print("-"*(60 + len(" App Starting ")) + "\n")
|
142 |
|
143 |
print("Launching Gradio Interface for Basic Agent Evaluation...")
|
144 |
+
demo.launch(debug=True, share=False)
|