bentrevett commited on
Commit
b5a8c50
1 Parent(s): d42374c

remove ability to predict on empty text with button

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -27,7 +27,7 @@ with st.spinner("Loading model..."):
27
  text = st.text_area('Enter text here:')
28
  submit = st.button('Predict')
29
 
30
- if submit or len(text) > 0:
31
 
32
  prediction = pipe(text)[0]
33
  prediction = sort_predictions(prediction)
 
27
  text = st.text_area('Enter text here:')
28
  submit = st.button('Predict')
29
 
30
+ if (submit and len(text.strip()) > 0) or len(text.strip()) > 0:
31
 
32
  prediction = pipe(text)[0]
33
  prediction = sort_predictions(prediction)