Noctis77 commited on
Commit
17b3b22
1 Parent(s): 4523c5c

[UPD] app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -4,17 +4,14 @@ import numpy as np
4
  import pickle
5
  import IPython.display as ipd
6
  from sklearn.preprocessing import LabelEncoder
 
7
 
8
 
9
  model_path = 'model/audio_prediction_model.pkl'
10
 
11
  le = LabelEncoder()
12
 
13
- with open(model_path, 'rb') as model_file:
14
- try:
15
- model = pickle.load(model_file)
16
- except Exception as e:
17
- st.error(f"Erreur lors du chargement du modèle : {e}")
18
 
19
 
20
  def prediction_audio(audiofile, model):
 
4
  import pickle
5
  import IPython.display as ipd
6
  from sklearn.preprocessing import LabelEncoder
7
+ from tensorflow.keras.models import load_model
8
 
9
 
10
  model_path = 'model/audio_prediction_model.pkl'
11
 
12
  le = LabelEncoder()
13
 
14
+ model = load_model('model/audio_prediction_model.h5')
 
 
 
 
15
 
16
 
17
  def prediction_audio(audiofile, model):