throgletworld commited on
Commit
78ebc76
·
verified ·
1 Parent(s): 431e771

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +2 -1
  2. requirements.txt +1 -0
app.py CHANGED
@@ -112,7 +112,8 @@ def load_models():
112
 
113
  def preprocess_audio(audio_path):
114
  """Convert audio to 16kHz mono"""
115
- waveform, sr = torchaudio.load(audio_path)
 
116
 
117
  # Convert to mono
118
  if waveform.shape[0] > 1:
 
112
 
113
  def preprocess_audio(audio_path):
114
  """Convert audio to 16kHz mono"""
115
+ # Use soundfile backend to avoid torchcodec dependency
116
+ waveform, sr = torchaudio.load(audio_path, backend="soundfile")
117
 
118
  # Convert to mono
119
  if waveform.shape[0] > 1:
requirements.txt CHANGED
@@ -7,3 +7,4 @@ transformers>=4.30.0
7
  gradio>=4.0.0
8
  openai-whisper>=20231117
9
  numpy>=1.24.0
 
 
7
  gradio>=4.0.0
8
  openai-whisper>=20231117
9
  numpy>=1.24.0
10
+ soundfile>=0.12.0