datawithsuman commited on
Commit
02f1b5e
1 Parent(s): 4b43b43

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -34,6 +34,8 @@ uploaded_files = st.file_uploader("Upload a PDF file", type="pdf", accept_multip
34
 
35
  if uploaded_files:
36
  for uploaded_file in uploaded_files:
 
 
37
  reader = SimpleDirectoryReader(input_files=[f"../data/{uploaded_file.name}"])
38
  documents = reader.load_data()
39
  st.success("File uploaded...")
 
34
 
35
  if uploaded_files:
36
  for uploaded_file in uploaded_files:
37
+ with open(f"../data/{uploaded_file.name}", 'wb') as f:
38
+ f.write(uploaded_file.getbuffer())
39
  reader = SimpleDirectoryReader(input_files=[f"../data/{uploaded_file.name}"])
40
  documents = reader.load_data()
41
  st.success("File uploaded...")