saronium commited on
Commit
ab3968e
·
verified ·
1 Parent(s): e4412c8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -77,13 +77,13 @@ def preprocess_single_audio_vgg16(audio_data, sr, vgg16_model, pca_instance):
77
 
78
  def predict_language(audio_input):
79
  # Load VGG16 model
80
- if isinstance(audio_input, str):
81
  # Load the audio file
82
- audio, sr = librosa.load(audio_input, sr=None)
83
- else:
84
  # Get the sample rate and convert the audio data to float
85
- sr, audio = audio_input
86
- audio = audio.astype(np.float32)
87
 
88
  # Preprocess the single audio file using VGG16 for feature extraction
89
  preprocessed_features = preprocess_single_audio_vgg16(audio, sr, vgg16, pca)
 
77
 
78
  def predict_language(audio_input):
79
  # Load VGG16 model
80
+ if isinstance(audio_input, str):
81
  # Load the audio file
82
+ audio, sr = librosa.load(audio_input, sr=None)
83
+ else:
84
  # Get the sample rate and convert the audio data to float
85
+ sr, audio = audio_input
86
+ audio = audio.astype(np.float32)
87
 
88
  # Preprocess the single audio file using VGG16 for feature extraction
89
  preprocessed_features = preprocess_single_audio_vgg16(audio, sr, vgg16, pca)