Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -278,28 +278,28 @@ with gr.Blocks(title="π κ·μ¬μ΄ μ€ν 리 μ±") as demo:
|
|
| 278 |
|
| 279 |
# -- The Red Ball Tab --
|
| 280 |
with gr.TabItem("The Red Ball"):
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
|
| 304 |
# π μ± μ€ν
|
| 305 |
demo.launch()
|
|
|
|
| 278 |
|
| 279 |
# -- The Red Ball Tab --
|
| 280 |
with gr.TabItem("The Red Ball"):
|
| 281 |
+
state_index_red_ball = gr.State(value=the_red_ball_index)
|
| 282 |
+
state_text_red_ball = gr.State(value=the_red_ball_text)
|
| 283 |
+
|
| 284 |
+
story_text_red_ball = gr.HTML(value=f"<div class='story-text'>{the_red_ball_text}</div>")
|
| 285 |
+
story_image_red_ball = gr.Image(value=the_red_ball_image, width=300, height=300)
|
| 286 |
+
audio_output_red_ball = gr.Audio(value=the_red_ball_audio, autoplay=False)
|
| 287 |
+
|
| 288 |
+
with gr.Row():
|
| 289 |
+
next_button_red_ball = gr.Button("π λ€μ μ΄μΌκΈ°", elem_classes=["btn-custom", "next-btn"])
|
| 290 |
+
play_button_red_ball = gr.Button("π λ€μ λ£κΈ°", elem_classes=["btn-custom", "play-btn"])
|
| 291 |
+
|
| 292 |
+
next_button_red_ball.click(
|
| 293 |
+
fn=next_story,
|
| 294 |
+
inputs=[state_index_red_ball, gr.State(value=the_red_ball_story)],
|
| 295 |
+
outputs=[state_index_red_ball, story_text_red_ball, story_image_red_ball, audio_output_red_ball, state_text_red_ball]
|
| 296 |
+
)
|
| 297 |
+
|
| 298 |
+
play_button_red_ball.click(
|
| 299 |
+
fn=play_story,
|
| 300 |
+
inputs=[state_text_red_ball],
|
| 301 |
+
outputs=[audio_output_red_ball]
|
| 302 |
+
)
|
| 303 |
|
| 304 |
# π μ± μ€ν
|
| 305 |
demo.launch()
|