Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,12 +1,12 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import numpy as np
|
| 3 |
-
import tensorflow as tf
|
| 4 |
import pickle
|
| 5 |
-
from
|
|
|
|
| 6 |
|
| 7 |
# Load model from Hugging Face Hub
|
| 8 |
model_path = hf_hub_download(repo_id="i0xs0/Sentiment_Analysis_DeepLr", filename="AC-BiLSTM_Model.h5")
|
| 9 |
-
model =
|
| 10 |
|
| 11 |
# Load tokenizer from Hugging Face Hub
|
| 12 |
tokenizer_path = hf_hub_download(repo_id="i0xs0/Sentiment_Analysis_DeepLr", filename="tokenizer_AC-BiLSTM.pkl")
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import numpy as np
|
|
|
|
| 3 |
import pickle
|
| 4 |
+
from keras.preprocessing.sequence import pad_sequences
|
| 5 |
+
import keras
|
| 6 |
|
| 7 |
# Load model from Hugging Face Hub
|
| 8 |
model_path = hf_hub_download(repo_id="i0xs0/Sentiment_Analysis_DeepLr", filename="AC-BiLSTM_Model.h5")
|
| 9 |
+
model = keras.models.load_model(model_path)
|
| 10 |
|
| 11 |
# Load tokenizer from Hugging Face Hub
|
| 12 |
tokenizer_path = hf_hub_download(repo_id="i0xs0/Sentiment_Analysis_DeepLr", filename="tokenizer_AC-BiLSTM.pkl")
|