Spaces:
Sleeping
Sleeping
OthmaneLKH
commited on
Commit
•
007a343
1
Parent(s):
26668c5
Update app.py
Browse files
app.py
CHANGED
@@ -474,8 +474,9 @@ def check_btn(btn):
|
|
474 |
|
475 |
def transcribe():
|
476 |
return 'Success'
|
477 |
-
|
478 |
-
|
|
|
479 |
# Prétraitement de l'audio
|
480 |
audio = preprocess_audio(audio_path)
|
481 |
|
@@ -486,7 +487,7 @@ def transcribe_audio(audio_path):
|
|
486 |
transcription = transcribe_audio(model,audio)
|
487 |
|
488 |
return transcription
|
489 |
-
|
490 |
|
491 |
demo = gr.Blocks(css=".markdown-body { font-size: 18px; }")
|
492 |
|
@@ -545,7 +546,7 @@ with demo:
|
|
545 |
transcription_output = gr.Textbox(label="Transcription", lines=5)
|
546 |
|
547 |
transcribe_btn.click(
|
548 |
-
fn=
|
549 |
inputs=[audio_output],
|
550 |
outputs=[transcription_output]
|
551 |
)
|
@@ -582,7 +583,7 @@ with demo:
|
|
582 |
|
583 |
audio_btn.click(fn=action, inputs=audio_btn, outputs=audio_btn) \
|
584 |
.then(fn=check_btn, inputs=audio_btn) \
|
585 |
-
.success(fn=
|
586 |
|
587 |
clear.click(lambda: None, None, msg, queue=False)
|
588 |
|
@@ -592,7 +593,7 @@ with demo:
|
|
592 |
transcription_output = gr.Textbox(label="Transcription", lines=5)
|
593 |
|
594 |
transcribe_btn.click(
|
595 |
-
fn=
|
596 |
inputs=[audio_output],
|
597 |
outputs=[transcription_output]
|
598 |
)
|
|
|
474 |
|
475 |
def transcribe():
|
476 |
return 'Success'
|
477 |
+
|
478 |
+
|
479 |
+
def transcribe_audio_app(audio_path):
|
480 |
# Prétraitement de l'audio
|
481 |
audio = preprocess_audio(audio_path)
|
482 |
|
|
|
487 |
transcription = transcribe_audio(model,audio)
|
488 |
|
489 |
return transcription
|
490 |
+
|
491 |
|
492 |
demo = gr.Blocks(css=".markdown-body { font-size: 18px; }")
|
493 |
|
|
|
546 |
transcription_output = gr.Textbox(label="Transcription", lines=5)
|
547 |
|
548 |
transcribe_btn.click(
|
549 |
+
fn=transcribe_audio_app,
|
550 |
inputs=[audio_output],
|
551 |
outputs=[transcription_output]
|
552 |
)
|
|
|
583 |
|
584 |
audio_btn.click(fn=action, inputs=audio_btn, outputs=audio_btn) \
|
585 |
.then(fn=check_btn, inputs=audio_btn) \
|
586 |
+
.success(fn=transcribe_audio_app, outputs=msg)
|
587 |
|
588 |
clear.click(lambda: None, None, msg, queue=False)
|
589 |
|
|
|
593 |
transcription_output = gr.Textbox(label="Transcription", lines=5)
|
594 |
|
595 |
transcribe_btn.click(
|
596 |
+
fn=transcribe_audio_app,
|
597 |
inputs=[audio_output],
|
598 |
outputs=[transcription_output]
|
599 |
)
|