itsalissonsilva commited on
Commit
658dc42
·
verified ·
1 Parent(s): de095ad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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, readonly=True, lines=7)
37
- choices_buttons = [gr.Button(choice, elem_id=f"choice_{i}") for i, choice in enumerate(choices)]
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()