Spaces:
Running
Running
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +5 -2
src/streamlit_app.py
CHANGED
|
@@ -1,5 +1,8 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
from annotated_text import annotated_text
|
| 5 |
# from nltk.tokenize import word_tokenize
|
|
@@ -163,7 +166,7 @@ if choice == 'Text Input':
|
|
| 163 |
annotated_text(my_list)
|
| 164 |
|
| 165 |
if choice == 'File Upload':
|
| 166 |
-
uploaded_file = st.file_uploader("Upload your File in .txt format", type=
|
| 167 |
if uploaded_file is not None:
|
| 168 |
lines = uploaded_file.read().decode('utf-8').splitlines()
|
| 169 |
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
# Disable XSRF protection (needed for uploads in Docker sometimes)
|
| 3 |
+
st.set_option("server.enableXsrfProtection", False)
|
| 4 |
+
# Increase max upload size (if needed)
|
| 5 |
+
st.set_option("server.maxUploadSize", 500)
|
| 6 |
|
| 7 |
from annotated_text import annotated_text
|
| 8 |
# from nltk.tokenize import word_tokenize
|
|
|
|
| 166 |
annotated_text(my_list)
|
| 167 |
|
| 168 |
if choice == 'File Upload':
|
| 169 |
+
uploaded_file = st.file_uploader("Upload your File in .txt format", type=["txt"])
|
| 170 |
if uploaded_file is not None:
|
| 171 |
lines = uploaded_file.read().decode('utf-8').splitlines()
|
| 172 |
|