papasega commited on
Commit
45f3f4a
1 Parent(s): 7eb3150

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -14
app.py CHANGED
@@ -4,20 +4,14 @@ import gradio as gr
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",
20
- output_label="Transcription alphabet latin"
21
- )
22
 
23
  demo.launch()
 
4
  model = EncoderASR.from_hparams("speechbrain/asr-wav2vec2-dvoice-wolof")
5
 
6
  def transcribe(audio):
7
+ return model.transcribe_file(audio.name)
8
 
9
+ demo = gr.Interface(
10
+ fn=transcribe,
11
+ inputs=gr.Audio(source="upload", type="file", label="Audio en wolof"),
12
+ outputs=gr.Textbox(label="Transcription alphabet latin"),
13
+ title="Transcription audio en wolof latin by PSW",
14
+ description="Ce modèle transcrit un fichier audio en wolof en texte en utilisant l'alphabet latin."
15
+ )
 
 
 
 
 
 
16
 
17
  demo.launch()