Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,10 +3,9 @@ import torch
|
|
3 |
import gradio as gr
|
4 |
import librosa
|
5 |
import numpy as np
|
6 |
-
import os
|
7 |
|
|
|
8 |
|
9 |
-
p = pipeline("automatic-speech-recognition", model="aware-ai/wav2vec2-base-german")
|
10 |
model, utils = torch.hub.load(repo_or_dir='snakers4/silero-vad',
|
11 |
model='silero_vad')
|
12 |
|
@@ -41,13 +40,9 @@ def transcribe(audio, state={"text": "", "temp_text": "", "audio": None}):
|
|
41 |
return f'{state["text"]} ( {state["temp_text"]} )', state
|
42 |
|
43 |
gr.Interface(
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
"textbox",
|
51 |
-
"state"
|
52 |
-
],
|
53 |
-
live=True).launch()
|
|
|
3 |
import gradio as gr
|
4 |
import librosa
|
5 |
import numpy as np
|
|
|
6 |
|
7 |
+
p = pipeline("automatic-speech-recognition", model="wav2vec2-base-german")
|
8 |
|
|
|
9 |
model, utils = torch.hub.load(repo_or_dir='snakers4/silero-vad',
|
10 |
model='silero_vad')
|
11 |
|
|
|
40 |
return f'{state["text"]} ( {state["temp_text"]} )', state
|
41 |
|
42 |
gr.Interface(
|
43 |
+
transcribe,
|
44 |
+
[gr.Audio(source="microphone", type="filepath", streaming=True), "state"],
|
45 |
+
|
46 |
+
[gr.Textbox(),"state"],
|
47 |
+
live=True
|
48 |
+
).launch()
|
|
|
|
|
|
|
|