Update app.py
Browse files
app.py
CHANGED
|
@@ -1,13 +1,12 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import numpy as np
|
| 3 |
import tensorflow as tf
|
| 4 |
-
import
|
| 5 |
from tensorflow.keras.preprocessing.sequence import pad_sequences
|
| 6 |
|
| 7 |
# Load model and tokenizer
|
| 8 |
model = tf.keras.models.load_model("sentiment_model.h5")
|
| 9 |
-
|
| 10 |
-
tokenizer = pickle.load(f)
|
| 11 |
|
| 12 |
max_len = 40
|
| 13 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import numpy as np
|
| 3 |
import tensorflow as tf
|
| 4 |
+
import joblib
|
| 5 |
from tensorflow.keras.preprocessing.sequence import pad_sequences
|
| 6 |
|
| 7 |
# Load model and tokenizer
|
| 8 |
model = tf.keras.models.load_model("sentiment_model.h5")
|
| 9 |
+
tokenizer = joblib.load("tokenizer.joblib")
|
|
|
|
| 10 |
|
| 11 |
max_len = 40
|
| 12 |
|