pgilles commited on
Commit
30f1ebe
·
1 Parent(s): dc530f1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -28,19 +28,19 @@ def load_data(input_file):
28
  #speech = librosa.effects.trim(speech, top_db= 10)
29
  return speech
30
 
31
- def asr_pipe(input_file, input_file_microphone):
32
  input_file = input_file_microphone if input_file_microphone else input_file
33
- transcription = pipe(input_file, chunk_length_s= 30)["text"]
34
  return transcription
35
 
36
  inputs = [gr.inputs.Audio(source="upload", type='filepath', label="Eng Audio-Datei eroplueden...", optional = True),
37
  gr.inputs.Audio(source="microphone", type="filepath", label="... oder direkt mam Mikro ophuelen", optional = True),
38
- #gr.Slider(minimum=3, maximum=32, value=29, step=0.5, label="Chunk Length")
39
  ]
40
 
41
  outputs = [gr.outputs.Textbox(label="Erkannten Text")]
42
 
43
- samples = [["Chamber2022_1.wav", "Chamber2022_1.wav", 30], ["Chamber2022_1.wav", "Chamber2022_2.wav", 20], ["Chamber2022_2.wav", "Chamber2022_3.wav", 30], ["Erlieft-a-Verzielt.wav", "Erlieft-a-Verzielt.wav", 28.5]]
44
 
45
  gr.Interface(fn = asr_pipe,
46
  inputs = inputs,
 
28
  #speech = librosa.effects.trim(speech, top_db= 10)
29
  return speech
30
 
31
+ def asr_pipe(input_file, input_file_microphone, chunks):
32
  input_file = input_file_microphone if input_file_microphone else input_file
33
+ transcription = pipe(input_file, chunk_length_s= chunks)["text"]
34
  return transcription
35
 
36
  inputs = [gr.inputs.Audio(source="upload", type='filepath', label="Eng Audio-Datei eroplueden...", optional = True),
37
  gr.inputs.Audio(source="microphone", type="filepath", label="... oder direkt mam Mikro ophuelen", optional = True),
38
+ gr.Slider(minimum=3, maximum=32, value=29, step=0.5, label="Chunk Length")
39
  ]
40
 
41
  outputs = [gr.outputs.Textbox(label="Erkannten Text")]
42
 
43
+ samples = [["Chamber2022_1.wav", "Chamber2022_1.wav", 30], ["Chamber2022_2.wav", "Chamber2022_2.wav", 20], ["Chamber2022_3.wav", "Chamber2022_3.wav", 30], ["Erlieft-a-Verzielt.wav", "Erlieft-a-Verzielt.wav", 28.5]]
44
 
45
  gr.Interface(fn = asr_pipe,
46
  inputs = inputs,