tonytz commited on
Commit
abd8c0e
1 Parent(s): c8e5164

Update app.py

Browse files

adding line to load audo classifier pkl model

Files changed (1) hide show
  1. app.py +2 -2
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
- model_path = "https://github.com/sarufi-io/AUDIO-ANALYSIS-WITH-LIBROSA/tree/main/My_model/cat_dog_audio_classifier/"
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)