Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -157,7 +157,12 @@ with gr.Blocks() as demo:
|
|
| 157 |
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.
|
| 158 |
"""
|
| 159 |
)
|
| 160 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 161 |
gr.LoginButton()
|
| 162 |
|
| 163 |
run_button = gr.Button("Run Evaluation & Submit All Answers")
|
|
|
|
| 157 |
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.
|
| 158 |
"""
|
| 159 |
)
|
| 160 |
+
api_url = DEFAULT_API_URL
|
| 161 |
+
questions_url = f"{api_url}/questions"
|
| 162 |
+
response = requests.get(questions_url, timeout=15)
|
| 163 |
+
response.raise_for_status()
|
| 164 |
+
questions_data = response.json()
|
| 165 |
+
gr.Markdown(questions_data)
|
| 166 |
gr.LoginButton()
|
| 167 |
|
| 168 |
run_button = gr.Button("Run Evaluation & Submit All Answers")
|