Haopeng commited on
Commit
3091b63
·
1 Parent(s): f90c681

add torchaudio

Browse files
Files changed (3) hide show
  1. app.py +2 -0
  2. requirement.txt +0 -4
  3. requirements.txt +2 -1
app.py CHANGED
@@ -32,6 +32,8 @@ def filler_transcribe_with_timestamps(audio, filler=False):
32
 
33
  # load dummy dataset and read audio files
34
  sample, sr= torchaudio.load(audio)
 
 
35
  # if sr != 16000, resample to 16000
36
  if sr != 16000:
37
  sample = torchaudio.transforms.Resample(sr, 16000)(sample)
 
32
 
33
  # load dummy dataset and read audio files
34
  sample, sr= torchaudio.load(audio)
35
+ if sample.shape[0] > 1:
36
+ sample = sample.mean(dim=0, keepdim=True)
37
  # if sr != 16000, resample to 16000
38
  if sr != 16000:
39
  sample = torchaudio.transforms.Resample(sr, 16000)(sample)
requirement.txt DELETED
@@ -1,4 +0,0 @@
1
- torch
2
- gradio
3
- transformers
4
- gradio_client
 
 
 
 
 
requirements.txt CHANGED
@@ -1,4 +1,5 @@
1
  torch
2
  gradio
3
  transformers
4
- gradio_client
 
 
1
  torch
2
  gradio
3
  transformers
4
+ gradio_client
5
+ torchaudio