updated app.py to hide results behind an accordian
Browse files
app.py
CHANGED
@@ -64,13 +64,25 @@ def add_guess(guess):
|
|
64 |
f"Not enough data to compute confidence interval."
|
65 |
)
|
66 |
|
67 |
-
demo = gr.Interface(
|
68 |
-
fn=add_guess,
|
69 |
-
inputs=gr.Number(label="Enter your guess"),
|
70 |
-
outputs="text",
|
71 |
-
title="Collective Guessing Game",
|
72 |
-
description="Submit your guess and contribute to the global average!"
|
73 |
-
)
|
74 |
|
75 |
|
76 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
f"Not enough data to compute confidence interval."
|
65 |
)
|
66 |
|
67 |
+
#demo = gr.Interface(
|
68 |
+
# fn=add_guess,
|
69 |
+
# inputs=gr.Number(label="Enter your guess"),
|
70 |
+
# outputs="text",
|
71 |
+
# title="Collective Guessing Game",
|
72 |
+
# description="Submit your guess and contribute to the global average!"
|
73 |
+
#)
|
74 |
|
75 |
|
76 |
+
with gr.Blocks() as demo:
|
77 |
+
gr.Markdown("# Collective Guessing Game")
|
78 |
+
gr.Markdown("Submit your guess and contribute to the global average!")
|
79 |
+
|
80 |
+
guess_input = gr.Number(label="Enter your guess")
|
81 |
+
submit_button = gr.Button("Submit Guess")
|
82 |
+
|
83 |
+
with gr.Accordion("View Current Results!", open=False):
|
84 |
+
output_text = gr.Textbox(label="Results", lines=10)
|
85 |
+
|
86 |
+
submit_button.click(fn=add_guess, inputs=guess_input, outputs=output_text)
|
87 |
+
|
88 |
+
demo.launch()
|