papasega commited on
Commit
99753a5
1 Parent(s): 9a90095

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
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
- 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", "microphone"], outputs="text",
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",