openfree commited on
Commit
46b8860
Β·
verified Β·
1 Parent(s): 0005a78

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -755,12 +755,6 @@ css = """
755
  background: #e3f2fd;
756
  color: #1565c0;
757
  }
758
- .buffer-info {
759
- font-size: 0.9em;
760
- color: #666;
761
- text-align: center;
762
- margin-top: 5px;
763
- }
764
  """
765
 
766
  with gr.Blocks(title="πŸ€– λ‘œλ΄‡ μ‹œκ° μ‹œμŠ€ν…œ (Gemma3-4B)", css=css) as demo:
@@ -1241,12 +1235,16 @@ with gr.Blocks(title="πŸ€– λ‘œλ΄‡ μ‹œκ° μ‹œμŠ€ν…œ (Gemma3-4B)", css=css) as dem
1241
  # μ˜€λ””μ˜€ λ…ΉμŒ μ™„λ£Œ μ‹œ 처리
1242
  def on_audio_recorded(audio_data):
1243
  """μ˜€λ””μ˜€ λ…ΉμŒ μ™„λ£Œ μ‹œ μžλ™ 처리"""
 
 
1244
  if audio_data is not None:
1245
  logger.info("μƒˆ μ˜€λ””μ˜€ λ…ΉμŒ 감지")
1246
  transcription = process_audio_recording(audio_data)
1247
  if transcription:
1248
  return transcription
1249
- return last_transcript.value
 
 
1250
 
1251
  audio_recorder.change(
1252
  fn=on_audio_recorded,
 
755
  background: #e3f2fd;
756
  color: #1565c0;
757
  }
 
 
 
 
 
 
758
  """
759
 
760
  with gr.Blocks(title="πŸ€– λ‘œλ΄‡ μ‹œκ° μ‹œμŠ€ν…œ (Gemma3-4B)", css=css) as demo:
 
1235
  # μ˜€λ””μ˜€ λ…ΉμŒ μ™„λ£Œ μ‹œ 처리
1236
  def on_audio_recorded(audio_data):
1237
  """μ˜€λ””μ˜€ λ…ΉμŒ μ™„λ£Œ μ‹œ μžλ™ 처리"""
1238
+ global last_transcription
1239
+
1240
  if audio_data is not None:
1241
  logger.info("μƒˆ μ˜€λ””μ˜€ λ…ΉμŒ 감지")
1242
  transcription = process_audio_recording(audio_data)
1243
  if transcription:
1244
  return transcription
1245
+
1246
+ with audio_lock:
1247
+ return last_transcription if last_transcription else "μŒμ„± 인식 λŒ€κΈ° 쀑..."
1248
 
1249
  audio_recorder.change(
1250
  fn=on_audio_recorded,