Spaces:
Sleeping
Sleeping
Upload 6 files
Browse files- prediction.py +3 -4
prediction.py
CHANGED
|
@@ -21,14 +21,13 @@ def get_feeling(number):
|
|
| 21 |
def load_model():
|
| 22 |
return tf.keras.models.load_model('model.keras', custom_objects={'KerasLayer': tf_hub.KerasLayer})
|
| 23 |
|
| 24 |
-
if 'the_model' not in st.session_state:
|
| 25 |
-
with st.spinner("Loading the model, please wait..."):
|
| 26 |
-
st.session_state.the_model = load_model()
|
| 27 |
-
|
| 28 |
def app():
|
| 29 |
st.header('Prediction', divider='rainbow')
|
| 30 |
|
| 31 |
user_input = st.text_input("Enter your text here:")
|
|
|
|
|
|
|
|
|
|
| 32 |
if st.button('Predict', type="secondary"):
|
| 33 |
data = {
|
| 34 |
"text_processed": [
|
|
|
|
| 21 |
def load_model():
|
| 22 |
return tf.keras.models.load_model('model.keras', custom_objects={'KerasLayer': tf_hub.KerasLayer})
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
def app():
|
| 25 |
st.header('Prediction', divider='rainbow')
|
| 26 |
|
| 27 |
user_input = st.text_input("Enter your text here:")
|
| 28 |
+
if 'the_model' not in st.session_state:
|
| 29 |
+
with st.spinner("Loading the model, please wait..."):
|
| 30 |
+
st.session_state.the_model = load_model()
|
| 31 |
if st.button('Predict', type="secondary"):
|
| 32 |
data = {
|
| 33 |
"text_processed": [
|