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