Spaces:
Running
Running
Handle short input
Browse files
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) <
|
|
|
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)
|