awacke1 commited on
Commit
0fc8f14
Β·
1 Parent(s): c38d5ad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py CHANGED
@@ -32,6 +32,17 @@ selectCollectionDocument(u"TimeSeries", u"DocumentofMinute")
32
 
33
 
34
  asr = pipeline("automatic-speech-recognition", "facebook/wav2vec2-base-960h")
 
 
 
 
 
 
 
 
 
 
 
35
  classifier = pipeline("text-classification")
36
 
37
  def speech_to_text(speech):
 
32
 
33
 
34
  asr = pipeline("automatic-speech-recognition", "facebook/wav2vec2-base-960h")
35
+
36
+ def transcribe(audio):
37
+ text = asr(audio)["text"]
38
+ return text
39
+
40
+ gr.Interface(
41
+ fn=transcribe,
42
+ inputs=gr.inputs.Audio(source="microphone", type="filepath"),
43
+ outputs="text").launch()
44
+
45
+
46
  classifier = pipeline("text-classification")
47
 
48
  def speech_to_text(speech):