haepada commited on
Commit
7eac455
·
verified ·
1 Parent(s): 5a4c19d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -6
app.py CHANGED
@@ -1,4 +1,3 @@
1
- # 라이브러리 임포트 및 초기 설정
2
  import gradio as gr
3
  import numpy as np
4
  import librosa
@@ -80,7 +79,6 @@ WORLDVIEW_MESSAGE = """
80
  이 앱은 온천천의 사운드스케이프를 녹음하여 제작되었으며,
81
  온천천 온천장역에서 장전역까지 걸으며 더 깊은 체험이 가능합니다.
82
  """
83
-
84
  def calculate_baseline_features(audio_data):
85
  """기준점 음성 특성 분석"""
86
  try:
@@ -209,7 +207,7 @@ def analyze_voice(audio_data, state):
209
  f"- 음성 크기: {voice_emotion['details']['voice_volume']}"
210
  )
211
 
212
- text_result = f"텍스트 감정 분석 (1-5): {text_sentiment['label']} (점수: {text_sentiment['score']:.2f})"
213
 
214
  # 프롬프트 생성
215
  prompt = generate_detailed_prompt(text, voice_emotion, text_sentiment)
@@ -334,7 +332,6 @@ def create_interface():
334
  gr.Markdown("'당신의 건강과 행복이 늘 가득하기를'")
335
  baseline_audio = gr.Audio(
336
  label="축원 문장 녹음하기",
337
- source="microphone",
338
  type="numpy"
339
  )
340
  set_baseline_btn = gr.Button("기준점 설정 완료")
@@ -371,7 +368,6 @@ def create_interface():
371
  with gr.Column():
372
  voice_input = gr.Audio(
373
  label="소원을 나누고 싶은 마음을 말해주세요",
374
- source="microphone",
375
  type="numpy"
376
  )
377
  clear_btn = gr.Button("녹음 지우기")
@@ -460,4 +456,3 @@ def create_interface():
460
  if __name__ == "__main__":
461
  demo = create_interface()
462
  demo.launch(debug=True, share=True)
463
-
 
 
1
  import gradio as gr
2
  import numpy as np
3
  import librosa
 
79
  이 앱은 온천천의 사운드스케이프를 녹음하여 제작되었으며,
80
  온천천 온천장역에서 장전역까지 걸으며 더 깊은 체험이 가능합니다.
81
  """
 
82
  def calculate_baseline_features(audio_data):
83
  """기준점 음성 특성 분석"""
84
  try:
 
207
  f"- 음성 크기: {voice_emotion['details']['voice_volume']}"
208
  )
209
 
210
+ text_result = f"텍스트 감정 분석: {text_sentiment['label']} (점수: {text_sentiment['score']:.2f})"
211
 
212
  # 프롬프트 생성
213
  prompt = generate_detailed_prompt(text, voice_emotion, text_sentiment)
 
332
  gr.Markdown("'당신의 건강과 행복이 늘 가득하기를'")
333
  baseline_audio = gr.Audio(
334
  label="축원 문장 녹음하기",
 
335
  type="numpy"
336
  )
337
  set_baseline_btn = gr.Button("기준점 설정 완료")
 
368
  with gr.Column():
369
  voice_input = gr.Audio(
370
  label="소원을 나누고 싶은 마음을 말해주세요",
 
371
  type="numpy"
372
  )
373
  clear_btn = gr.Button("녹음 지우기")
 
456
  if __name__ == "__main__":
457
  demo = create_interface()
458
  demo.launch(debug=True, share=True)