Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -18,10 +18,8 @@ pc = Pinecone(api_key=pinecone_api_key)
|
|
18 |
|
19 |
# Function to process PDF and set up chatbot
|
20 |
def process_pdf(pdf_doc):
|
21 |
-
#
|
22 |
filename = pdf_doc.name
|
23 |
-
with open(filename, "wb") as f:
|
24 |
-
f.write(pdf_doc.read())
|
25 |
|
26 |
# Load PDF and create index
|
27 |
loader = PyPDFLoader(filename)
|
|
|
18 |
|
19 |
# Function to process PDF and set up chatbot
|
20 |
def process_pdf(pdf_doc):
|
21 |
+
# Use the file path directly
|
22 |
filename = pdf_doc.name
|
|
|
|
|
23 |
|
24 |
# Load PDF and create index
|
25 |
loader = PyPDFLoader(filename)
|