NimaKL commited on
Commit
0adf7d7
Β·
1 Parent(s): 0bc4f74

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -53,12 +53,12 @@ if st.button('Load Model', disabled=False):
53
  with torch.no_grad():
54
  output = model(test_ids.to(device), token_type_ids = None, attention_mask = test_attention_mask.to(device))
55
  prediction = 'Spam' if np.argmax(output.logits.cpu().numpy()).flatten().item() == 1 else 'Normal'
56
- pred = 'Predicted Class: '+ prediction
57
- with col2:
58
- st.header(pred)
59
- text = st.text_input("Enter the text you'd like to analyze for spam.")
60
- if text or st.button('Analyze'):
61
- predict(text)
62
 
63
 
64
 
 
53
  with torch.no_grad():
54
  output = model(test_ids.to(device), token_type_ids = None, attention_mask = test_attention_mask.to(device))
55
  prediction = 'Spam' if np.argmax(output.logits.cpu().numpy()).flatten().item() == 1 else 'Normal'
56
+ return pred = 'Predicted Class: '+ prediction
57
+ with col2:
58
+ st.header(p)
59
+ text = st.text_input("Enter the text you'd like to analyze for spam.")
60
+ if text or st.button('Analyze'):
61
+ predict(text)
62
 
63
 
64