Updated app,py
Browse files
app.py
CHANGED
@@ -79,9 +79,10 @@ async def on_chat_start():
|
|
79 |
await cl.Message(f"Processing '{pdf_file.name}'...").send()
|
80 |
|
81 |
try:
|
82 |
-
#
|
83 |
-
temp_file_path = f"
|
84 |
-
|
|
|
85 |
|
86 |
# Load and process the PDF
|
87 |
loader = PyMuPDFLoader(temp_file_path)
|
|
|
79 |
await cl.Message(f"Processing '{pdf_file.name}'...").send()
|
80 |
|
81 |
try:
|
82 |
+
# Save the uploaded file to a temporary location
|
83 |
+
temp_file_path = f"/tmp/{pdf_file.name}"
|
84 |
+
with open(temp_file_path, "wb") as f:
|
85 |
+
f.write(pdf_file.content)
|
86 |
|
87 |
# Load and process the PDF
|
88 |
loader = PyMuPDFLoader(temp_file_path)
|