Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ with col1:
|
|
11 |
|
12 |
with col2:
|
13 |
st.title("Model:")
|
14 |
-
if st.button('Load Model'):
|
15 |
with st.spinner('Wait for it...'):
|
16 |
|
17 |
import torch
|
@@ -65,11 +65,10 @@ with col2:
|
|
65 |
|
66 |
prediction = 'Spam' if np.argmax(output.logits.cpu().numpy()).flatten().item() == 1 else 'Normal'
|
67 |
pred = 'Predicted Class: '+ prediction
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
predict(text)
|
73 |
|
74 |
|
75 |
|
|
|
11 |
|
12 |
with col2:
|
13 |
st.title("Model:")
|
14 |
+
if st.button('Load Model', disabled=False):
|
15 |
with st.spinner('Wait for it...'):
|
16 |
|
17 |
import torch
|
|
|
65 |
|
66 |
prediction = 'Spam' if np.argmax(output.logits.cpu().numpy()).flatten().item() == 1 else 'Normal'
|
67 |
pred = 'Predicted Class: '+ prediction
|
68 |
+
st.header(pred)
|
69 |
+
text = st.text_input("Enter the text you'd like to analyze for spam.")
|
70 |
+
if text or st.button('Analyze'):
|
71 |
+
predict(text)
|
|
|
72 |
|
73 |
|
74 |
|