Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
| 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,
|