peter2000 commited on
Commit
b6d5ef6
β€’
1 Parent(s): d4c667e

Update appStore/multiapp.py

Browse files
Files changed (1) hide show
  1. 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['document'] = None
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
- if file is not None:
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
+