flozi00 commited on
Commit
0013fe8
·
1 Parent(s): 803e8b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -1,13 +1,16 @@
1
  from transformers import pipeline
2
  import gradio as gr
3
 
4
- p = pipeline("automatic-speech-recognition", model="aware-ai/wav2vec2-xls-r-1b-5gram-german")
5
 
6
  def transcribe(audio):
7
  return p(audio, chunk_length_s=10, stride_length_s=(4, 2))["text"]
8
 
9
  gr.Interface(
10
- transcribe,
11
- [gr.Audio(source="microphone", type="filepath")],
12
-
13
- [gr.Textbox()]).launch(server_name = "0.0.0.0")
 
 
 
 
1
  from transformers import pipeline
2
  import gradio as gr
3
 
4
+ p = pipeline("automatic-speech-recognition", model="aware-ai/wav2vec2-base-german", tokenizer = "aware-ai/wav2vec2-xls-r-1b-5gram-german")
5
 
6
  def transcribe(audio):
7
  return p(audio, chunk_length_s=10, stride_length_s=(4, 2))["text"]
8
 
9
  gr.Interface(
10
+ fn=transcribe,
11
+ inputs=[
12
+ gr.inputs.Audio(source="microphone", type="filepath")
13
+ ],
14
+ outputs=[
15
+ "textbox"
16
+ ]).launch(server_name = "0.0.0.0")