Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,14 @@
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
|
|
|
|
3 |
from tensorflow.keras.models import load_model
|
4 |
from tensorflow.keras.preprocessing.sequence import pad_sequences
|
5 |
-
from tensorflow.keras.
|
6 |
|
7 |
# Load the trained model
|
8 |
-
|
|
|
9 |
|
10 |
# Load the tokenizer
|
11 |
with open('tokenizer.pickle', 'rb') as handle:
|
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
+
import pickle
|
4 |
+
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
|
14 |
with open('tokenizer.pickle', 'rb') as handle:
|