NEXAS commited on
Commit
7f00801
·
verified ·
1 Parent(s): c3c4685

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -24,14 +24,14 @@ st.title("MULTIMODAL DOC QA")
24
  uploaded_file = st.file_uploader("File upload", type="pdf")
25
  if uploaded_file is not None:
26
  # Save the uploaded file to a temporary location
27
- #temp_file_path = os.path.join("temp", uploaded_file.name)
28
- #os.makedirs("temp", exist_ok=True) # Ensure the temp directory exists
29
- #with open(temp_file_path, "wb") as f:
30
- # f.write(uploaded_file.getbuffer())
31
 
32
  # Get the absolute path of the saved file
33
- temp_dir = tempfile.mkdtemp()
34
- path = os.path.join(temp_dir, uploaded_file.name)
35
  st.write(f"File saved to: {path}")
36
  print(path)
37
 
 
24
  uploaded_file = st.file_uploader("File upload", type="pdf")
25
  if uploaded_file is not None:
26
  # Save the uploaded file to a temporary location
27
+ temp_file_path = os.path.join("temp", uploaded_file.name)
28
+ os.makedirs("temp", exist_ok=True) # Ensure the temp directory exists
29
+ with open(temp_file_path, "wb") as f:
30
+ f.write(uploaded_file.getbuffer())
31
 
32
  # Get the absolute path of the saved file
33
+ #temp_dir = tempfile.mkdtemp()
34
+ path = os.path.abspath(temp_file_path)
35
  st.write(f"File saved to: {path}")
36
  print(path)
37