Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
|
32 |
# Get the absolute path of the saved file
|
33 |
-
temp_dir = tempfile.mkdtemp()
|
34 |
-
path = os.path.
|
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 |
|