Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -33,8 +33,8 @@ def update_scenario(choice_index):
|
|
| 33 |
# Gradio app
|
| 34 |
with gr.Blocks() as app:
|
| 35 |
with gr.Row():
|
| 36 |
-
story_display = gr.Textbox(value=scenario, show_label=False,
|
| 37 |
-
choices_buttons = [gr.Button(choice
|
| 38 |
|
| 39 |
def handle_choice(choice_index):
|
| 40 |
new_story = update_scenario(choice_index)
|
|
@@ -42,6 +42,6 @@ with gr.Blocks() as app:
|
|
| 42 |
return gr.update()
|
| 43 |
|
| 44 |
for i, button in enumerate(choices_buttons):
|
| 45 |
-
button.click(fn=handle_choice, inputs=i, outputs=story_display)
|
| 46 |
|
| 47 |
app.launch()
|
|
|
|
| 33 |
# Gradio app
|
| 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 |
def handle_choice(choice_index):
|
| 40 |
new_story = update_scenario(choice_index)
|
|
|
|
| 42 |
return gr.update()
|
| 43 |
|
| 44 |
for i, button in enumerate(choices_buttons):
|
| 45 |
+
button.click(fn=handle_choice, inputs=[i], outputs=story_display)
|
| 46 |
|
| 47 |
app.launch()
|