Chandranshu Jain
commited on
Commit
•
3096731
1
Parent(s):
7a9dcc4
Update app.py
Browse files
app.py
CHANGED
@@ -39,7 +39,7 @@ def get_pdf(uploaded_file):
|
|
39 |
file.write(uploaded_file.getvalue())
|
40 |
file_name = uploaded_file.name
|
41 |
loader = PyPDFLoader(temp_file)
|
42 |
-
docs = loader.
|
43 |
return docs
|
44 |
|
45 |
def text_splitter(text):
|
@@ -48,7 +48,7 @@ def text_splitter(text):
|
|
48 |
chunk_size=500,
|
49 |
chunk_overlap=20,
|
50 |
separators=["\n\n","\n"," ",".",","])
|
51 |
-
chunks=text_splitter.
|
52 |
return chunks
|
53 |
|
54 |
GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
|
|
|
39 |
file.write(uploaded_file.getvalue())
|
40 |
file_name = uploaded_file.name
|
41 |
loader = PyPDFLoader(temp_file)
|
42 |
+
docs = loader.load_and_split()
|
43 |
return docs
|
44 |
|
45 |
def text_splitter(text):
|
|
|
48 |
chunk_size=500,
|
49 |
chunk_overlap=20,
|
50 |
separators=["\n\n","\n"," ",".",","])
|
51 |
+
chunks=text_splitter.split_documents(text)
|
52 |
return chunks
|
53 |
|
54 |
GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
|