Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
[
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
|
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")
|