Spaces:
Running
Running
Chandranshu Jain
commited on
Commit
•
7a9dcc4
1
Parent(s):
91044c4
Update app.py
Browse files
app.py
CHANGED
@@ -32,12 +32,13 @@ Follow these simple steps to interact with the chatbot:
|
|
32 |
# docs = loader.load()
|
33 |
# return docs
|
34 |
|
35 |
-
def get_pdf(
|
36 |
-
if
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
|
|
41 |
docs = loader.load()
|
42 |
return docs
|
43 |
|
|
|
32 |
# docs = loader.load()
|
33 |
# return docs
|
34 |
|
35 |
+
def get_pdf(uploaded_file):
|
36 |
+
if uploaded_file :
|
37 |
+
temp_file = "./temp.pdf"
|
38 |
+
with open(temp_file, "wb") as file:
|
39 |
+
file.write(uploaded_file.getvalue())
|
40 |
+
file_name = uploaded_file.name
|
41 |
+
loader = PyPDFLoader(temp_file)
|
42 |
docs = loader.load()
|
43 |
return docs
|
44 |
|