Spaces:
Runtime error
Runtime error
Update appStore/multiapp.py
Browse files- appStore/multiapp.py +3 -15
appStore/multiapp.py
CHANGED
@@ -39,7 +39,7 @@ class MultiApp:
|
|
39 |
|
40 |
def run(self):
|
41 |
if 'file' not in st.session_state:
|
42 |
-
st.session_state['
|
43 |
|
44 |
st.sidebar.write(format_func=lambda app: app['title'])
|
45 |
image = Image.open('appStore/img/sdsn.png')
|
@@ -52,17 +52,5 @@ class MultiApp:
|
|
52 |
st.sidebar.markdown('')
|
53 |
st.sidebar.markdown("## π Upload document ")
|
54 |
file = st.sidebar.file_uploader('', type=['pdf', 'docx', 'txt']) #Upload PDF File
|
55 |
-
|
56 |
-
|
57 |
-
with tempfile.NamedTemporaryFile(mode="wb") as temp:
|
58 |
-
bytes_data = file.getvalue()
|
59 |
-
temp.write(bytes_data)
|
60 |
-
file_name = file.name
|
61 |
-
file_path = temp.name
|
62 |
-
|
63 |
-
st.write("Filename: ", file.name)
|
64 |
-
|
65 |
-
# load document
|
66 |
-
documents = pre.load_document(temp.name,file_name)
|
67 |
-
documents_processed = pre.preprocessing(documents)
|
68 |
-
st.session_state['documents'] = documents_processed
|
|
|
39 |
|
40 |
def run(self):
|
41 |
if 'file' not in st.session_state:
|
42 |
+
st.session_state['file'] = None
|
43 |
|
44 |
st.sidebar.write(format_func=lambda app: app['title'])
|
45 |
image = Image.open('appStore/img/sdsn.png')
|
|
|
52 |
st.sidebar.markdown('')
|
53 |
st.sidebar.markdown("## π Upload document ")
|
54 |
file = st.sidebar.file_uploader('', type=['pdf', 'docx', 'txt']) #Upload PDF File
|
55 |
+
st.session_state['file'] = file
|
56 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|