Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -34,14 +34,10 @@ def update_scenario(choice_index):
|
|
| 34 |
with gr.Blocks() as app:
|
| 35 |
with gr.Row():
|
| 36 |
story_display = gr.Textbox(value=scenario, show_label=False, lines=7)
|
| 37 |
-
choices_buttons = [gr.Button(choice) for choice in choices]
|
| 38 |
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
for i, button in enumerate(choices_buttons):
|
| 45 |
-
button.click(fn=handle_choice, inputs=[i], outputs=story_display)
|
| 46 |
|
| 47 |
app.launch()
|
|
|
|
| 34 |
with gr.Blocks() as app:
|
| 35 |
with gr.Row():
|
| 36 |
story_display = gr.Textbox(value=scenario, show_label=False, lines=7)
|
|
|
|
| 37 |
|
| 38 |
+
with gr.Row():
|
| 39 |
+
for i, choice in enumerate(choices):
|
| 40 |
+
button = gr.Button(choice)
|
| 41 |
+
button.click(fn=update_scenario, data=i, outputs=story_display)
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
app.launch()
|