Update app.py
Browse files
app.py
CHANGED
@@ -670,13 +670,13 @@ def create_interface():
|
|
670 |
analysis_status = gr.Markdown(visible=False)
|
671 |
analysis_result = gr.Markdown(visible=False)
|
672 |
|
673 |
-
|
674 |
"""축원 완료 및 분석 처리"""
|
675 |
if audio is None:
|
676 |
return (
|
677 |
state, # state
|
678 |
-
"음성을 먼저 녹음해주세요.",
|
679 |
-
|
680 |
gr.update(visible=True), # blessing_section visibility
|
681 |
gr.update(visible=False) # entry_guide_section visibility
|
682 |
)
|
@@ -687,7 +687,7 @@ def create_interface():
|
|
687 |
return (
|
688 |
state,
|
689 |
"음성 분석에 실패했습니다.",
|
690 |
-
|
691 |
gr.update(visible=True),
|
692 |
gr.update(visible=False)
|
693 |
)
|
@@ -709,18 +709,18 @@ def create_interface():
|
|
709 |
new_state = {**state, "baseline_features": features, "analysis_complete": True}
|
710 |
|
711 |
return (
|
712 |
-
new_state,
|
713 |
-
"축원이 완료되었습니다.",
|
714 |
-
analysis_text,
|
715 |
-
gr.update(visible=False),
|
716 |
-
gr.update(visible=True)
|
717 |
)
|
718 |
|
719 |
except Exception as e:
|
720 |
return (
|
721 |
state,
|
722 |
f"오류가 발생했습니다: {str(e)}",
|
723 |
-
|
724 |
gr.update(visible=True),
|
725 |
gr.update(visible=False)
|
726 |
)
|
@@ -1000,7 +1000,7 @@ def create_interface():
|
|
1000 |
outputs=[
|
1001 |
state, # 상태
|
1002 |
analysis_status, # 상태 메시지
|
1003 |
-
analysis_result, # 분석 결과
|
1004 |
blessing_section, # 축원 섹션
|
1005 |
entry_guide_section # 가이드 섹션
|
1006 |
]
|
|
|
670 |
analysis_status = gr.Markdown(visible=False)
|
671 |
analysis_result = gr.Markdown(visible=False)
|
672 |
|
673 |
+
def handle_blessing_complete(audio, state):
|
674 |
"""축원 완료 및 분석 처리"""
|
675 |
if audio is None:
|
676 |
return (
|
677 |
state, # state
|
678 |
+
"음성을 먼저 녹음해주세요.", # 상태 메시지
|
679 |
+
gr.update(visible=False), # 분석 결과
|
680 |
gr.update(visible=True), # blessing_section visibility
|
681 |
gr.update(visible=False) # entry_guide_section visibility
|
682 |
)
|
|
|
687 |
return (
|
688 |
state,
|
689 |
"음성 분석에 실패했습니다.",
|
690 |
+
gr.update(visible=False),
|
691 |
gr.update(visible=True),
|
692 |
gr.update(visible=False)
|
693 |
)
|
|
|
709 |
new_state = {**state, "baseline_features": features, "analysis_complete": True}
|
710 |
|
711 |
return (
|
712 |
+
new_state, # state
|
713 |
+
"축원이 완료되었습니다.", # 상태 메시지
|
714 |
+
gr.update(value=analysis_text, visible=True), # 분석 결과
|
715 |
+
gr.update(visible=False), # blessing_section visibility
|
716 |
+
gr.update(visible=True) # entry_guide_section visibility
|
717 |
)
|
718 |
|
719 |
except Exception as e:
|
720 |
return (
|
721 |
state,
|
722 |
f"오류가 발생했습니다: {str(e)}",
|
723 |
+
gr.update(visible=False),
|
724 |
gr.update(visible=True),
|
725 |
gr.update(visible=False)
|
726 |
)
|
|
|
1000 |
outputs=[
|
1001 |
state, # 상태
|
1002 |
analysis_status, # 상태 메시지
|
1003 |
+
analysis_result, # 분석 결과
|
1004 |
blessing_section, # 축원 섹션
|
1005 |
entry_guide_section # 가이드 섹션
|
1006 |
]
|