Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,17 +3,17 @@ import gradio as gr
|
|
| 3 |
|
| 4 |
model = EncoderASR.from_hparams("speechbrain/asr-wav2vec2-dvoice-wolof")
|
| 5 |
|
| 6 |
-
# def transcribe(audio):
|
| 7 |
-
# return model.transcribe_file(audio.name)
|
| 8 |
-
|
| 9 |
def transcribe(audio):
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
|
| 16 |
-
demo = gr.Interface(fn=transcribe, inputs=["file"
|
| 17 |
title="Transcription audio en wolof latin by Papa Séga",
|
| 18 |
description="Ce modèle transcrit un fichier audio en wolof en texte en utilisant l'alphabet latin.",
|
| 19 |
input_label="Audio en wolof",
|
|
|
|
| 3 |
|
| 4 |
model = EncoderASR.from_hparams("speechbrain/asr-wav2vec2-dvoice-wolof")
|
| 5 |
|
|
|
|
|
|
|
|
|
|
| 6 |
def transcribe(audio):
|
| 7 |
+
return model.transcribe_file(audio.name)
|
| 8 |
+
|
| 9 |
+
# def transcribe(audio):
|
| 10 |
+
# if isinstance(audio, str): # If input is a file path
|
| 11 |
+
# return model.transcribe_file(audio)
|
| 12 |
+
# else: # If input is audio data from microphone
|
| 13 |
+
# return model.transcribe_array(audio)
|
| 14 |
|
| 15 |
|
| 16 |
+
demo = gr.Interface(fn=transcribe, inputs=["file"], outputs="text", ## , "microphone"
|
| 17 |
title="Transcription audio en wolof latin by Papa Séga",
|
| 18 |
description="Ce modèle transcrit un fichier audio en wolof en texte en utilisant l'alphabet latin.",
|
| 19 |
input_label="Audio en wolof",
|