Update app.py
Browse files
app.py
CHANGED
|
@@ -916,61 +916,61 @@ def create_interface():
|
|
| 916 |
return "오류가 발생했습니다.", []
|
| 917 |
|
| 918 |
# 이벤트 연결
|
| 919 |
-
|
| 920 |
-
|
| 921 |
-
|
| 922 |
-
|
| 923 |
-
|
| 924 |
|
| 925 |
-
|
| 926 |
-
|
| 927 |
-
|
| 928 |
-
|
| 929 |
|
| 930 |
-
|
| 931 |
-
|
| 932 |
-
|
| 933 |
-
|
| 934 |
-
|
| 935 |
|
| 936 |
-
|
| 937 |
-
|
| 938 |
-
|
| 939 |
-
|
| 940 |
|
| 941 |
-
|
| 942 |
-
|
| 943 |
-
|
| 944 |
-
|
| 945 |
|
| 946 |
-
|
| 947 |
-
|
| 948 |
-
|
| 949 |
-
|
| 950 |
-
|
| 951 |
|
| 952 |
-
|
| 953 |
-
|
| 954 |
-
|
| 955 |
-
|
| 956 |
|
| 957 |
-
|
| 958 |
-
|
| 959 |
-
|
| 960 |
-
|
| 961 |
-
|
| 962 |
|
| 963 |
-
|
| 964 |
-
|
| 965 |
-
|
| 966 |
-
|
| 967 |
-
|
| 968 |
|
| 969 |
-
|
| 970 |
-
|
| 971 |
-
|
| 972 |
-
|
| 973 |
-
|
| 974 |
|
| 975 |
return app
|
| 976 |
|
|
|
|
| 916 |
return "오류가 발생했습니다.", []
|
| 917 |
|
| 918 |
# 이벤트 연결
|
| 919 |
+
name_submit_btn.click(
|
| 920 |
+
fn=handle_name_submit,
|
| 921 |
+
inputs=[name_input, state],
|
| 922 |
+
outputs=[welcome_section, story_section, blessing_section, entry_guide_section, state]
|
| 923 |
+
)
|
| 924 |
|
| 925 |
+
continue_btn.click(
|
| 926 |
+
fn=handle_continue,
|
| 927 |
+
outputs=[story_section, welcome_section, blessing_section, entry_guide_section]
|
| 928 |
+
)
|
| 929 |
|
| 930 |
+
set_baseline_btn.click(
|
| 931 |
+
fn=handle_blessing_complete,
|
| 932 |
+
inputs=[baseline_audio, state],
|
| 933 |
+
outputs=[state, baseline_status, blessing_section, entry_guide_section]
|
| 934 |
+
)
|
| 935 |
|
| 936 |
+
enter_btn.click(
|
| 937 |
+
fn=handle_enter,
|
| 938 |
+
outputs=[tabs]
|
| 939 |
+
)
|
| 940 |
|
| 941 |
+
play_music_btn.click(
|
| 942 |
+
fn=lambda: "assets/main_music.mp3",
|
| 943 |
+
outputs=[audio]
|
| 944 |
+
)
|
| 945 |
|
| 946 |
+
save_btn.click(
|
| 947 |
+
fn=save_reflection_fixed, # handle_save_reflection -> save_reflection_fixed
|
| 948 |
+
inputs=[reflection_input, state],
|
| 949 |
+
outputs=[state, reflections_display]
|
| 950 |
+
)
|
| 951 |
|
| 952 |
+
clear_btn.click(
|
| 953 |
+
fn=lambda: None,
|
| 954 |
+
outputs=[voice_input]
|
| 955 |
+
)
|
| 956 |
|
| 957 |
+
analyze_btn.click(
|
| 958 |
+
fn=analyze_voice,
|
| 959 |
+
inputs=[voice_input, state],
|
| 960 |
+
outputs=[state, transcribed_text, voice_emotion, text_emotion, final_prompt]
|
| 961 |
+
)
|
| 962 |
|
| 963 |
+
generate_btn.click(
|
| 964 |
+
fn=generate_image_from_prompt,
|
| 965 |
+
inputs=[final_prompt],
|
| 966 |
+
outputs=[result_image]
|
| 967 |
+
)
|
| 968 |
|
| 969 |
+
save_final_btn.click(
|
| 970 |
+
fn=handle_save_wish,
|
| 971 |
+
inputs=[final_reflection, state],
|
| 972 |
+
outputs=[baseline_status, wishes_display]
|
| 973 |
+
)
|
| 974 |
|
| 975 |
return app
|
| 976 |
|