cifkao commited on
Commit
c290138
·
1 Parent(s): 8d171c2

Handle short input

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -63,7 +63,8 @@ inputs = tokenizer([text])
63
  [input_ids] = inputs["input_ids"]
64
  window_len = min(window_len, len(input_ids))
65
 
66
- if len(input_ids) < 1:
 
67
  st.stop()
68
 
69
  @st.cache_data(show_spinner=False)
 
63
  [input_ids] = inputs["input_ids"]
64
  window_len = min(window_len, len(input_ids))
65
 
66
+ if len(input_ids) < 2:
67
+ st.error("Please enter at least 2 tokens.", icon="🚨")
68
  st.stop()
69
 
70
  @st.cache_data(show_spinner=False)