Ahtisham1583 commited on
Commit
0f38151
·
verified ·
1 Parent(s): c0ac22c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -5,9 +5,10 @@ import tensorflow as tf
5
  from tensorflow.keras.models import load_model
6
  from tensorflow.keras.preprocessing.sequence import pad_sequences
7
  from tensorflow.keras.initializers import Orthogonal
 
8
 
9
  # Load the trained model
10
- custom_objects = {'Orthogonal': Orthogonal}
11
  model = load_model('sentiment_analysis_model.h5', custom_objects=custom_objects)
12
 
13
  # Load the tokenizer
@@ -47,3 +48,4 @@ interface = gr.Interface(
47
 
48
  if __name__ == "__main__":
49
  interface.launch()
 
 
5
  from tensorflow.keras.models import load_model
6
  from tensorflow.keras.preprocessing.sequence import pad_sequences
7
  from tensorflow.keras.initializers import Orthogonal
8
+ from tensorflow.keras.optimizers import Adam
9
 
10
  # Load the trained model
11
+ custom_objects = {'Orthogonal': Orthogonal, 'Adam': Adam}
12
  model = load_model('sentiment_analysis_model.h5', custom_objects=custom_objects)
13
 
14
  # Load the tokenizer
 
48
 
49
  if __name__ == "__main__":
50
  interface.launch()
51
+