Spaces:
Runtime error
Runtime error
Update app.py
Browse filesadding line to load audo classifier pkl model
app.py
CHANGED
@@ -3,6 +3,7 @@ import gradio as gr
|
|
3 |
import librosa
|
4 |
import pandas as pd
|
5 |
import numpy as np
|
|
|
6 |
|
7 |
import tensorflow as tf
|
8 |
from tensorflow.keras.layers.experimental import preprocessing
|
@@ -27,8 +28,7 @@ def get_spectrogram_label(audio):
|
|
27 |
return spectrogram
|
28 |
|
29 |
# %load saved model
|
30 |
-
|
31 |
-
model = tf.keras.models.load_model(model_path)
|
32 |
|
33 |
def get_audio(audio):
|
34 |
audio_waveform = get_waveform_label(audio)
|
|
|
3 |
import librosa
|
4 |
import pandas as pd
|
5 |
import numpy as np
|
6 |
+
import pickle
|
7 |
|
8 |
import tensorflow as tf
|
9 |
from tensorflow.keras.layers.experimental import preprocessing
|
|
|
28 |
return spectrogram
|
29 |
|
30 |
# %load saved model
|
31 |
+
model = pickle.load(open('audio_classifier_model.pkl', 'rb'))
|
|
|
32 |
|
33 |
def get_audio(audio):
|
34 |
audio_waveform = get_waveform_label(audio)
|