flozi00 commited on
Commit
1558352
·
1 Parent(s): 41d1235

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -12
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
- fn=transcribe,
45
- inputs=[
46
- gr.inputs.Audio(source="microphone", type="filepath"),
47
- "state"
48
- ],
49
- outputs=[
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()