Spaces:
Sleeping
Sleeping
File size: 866 Bytes
5faa5d1 d67a990 da24dee 34d644e da24dee 9a90095 da24dee 9876963 34d644e 2b70187 fe9c6c2 1041e83 5749237 1041e83 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
from speechbrain.inference.ASR import EncoderASR
import gradio as gr
model = EncoderASR.from_hparams("speechbrain/asr-wav2vec2-dvoice-wolof")
# def transcribe(audio):
# return model.transcribe_file(audio.name)
def transcribe(audio):
if isinstance(audio, str): # If input is a file path
return model.transcribe_file(audio)
else: # If input is audio data from microphone
return model.transcribe_array(audio)
demo = gr.Interface(fn=transcribe, inputs=["file", "microphone"], outputs="text",
title="Transcription audio en wolof latin by Papa Séga",
description="Ce modèle transcrit un fichier audio en wolof en texte en utilisant l'alphabet latin.",
input_label="Audio en wolof",
output_label="Transcription alphabet latin"
)
demo.launch()
|