Shrirang20 commited on
Commit
34d673d
·
verified ·
1 Parent(s): 393b1e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py CHANGED
@@ -350,6 +350,17 @@ def download_ai4b_asr_model(lang: str):
350
 
351
  os.makedirs('asr_models', exist_ok=True)
352
 
 
 
 
 
 
 
 
 
 
 
 
353
  import librosa
354
 
355
  def preprocess_audio(audio_path):
 
350
 
351
  os.makedirs('asr_models', exist_ok=True)
352
 
353
+ def ensure_numpy_version():
354
+ try:
355
+ import numpy as np
356
+ required_version = '1.23'
357
+ if np.__version__ != required_version:
358
+ subprocess.run(['pip', 'install', f'numpy=={required_version}'], check=True)
359
+ except ImportError:
360
+ subprocess.run(['pip', 'install', 'numpy==1.23'], check=True)
361
+
362
+ ensure_numpy_version()
363
+
364
  import librosa
365
 
366
  def preprocess_audio(audio_path):