Spaces:
Sleeping
Sleeping
Commit
·
6cc8723
1
Parent(s):
b2fe6e1
Minor fix
Browse files
app.py
CHANGED
|
@@ -33,7 +33,7 @@ def extract_text_from_pdf(pdf_path):
|
|
| 33 |
raw_documents.extend(PyPDFLoader(path).load())
|
| 34 |
return raw_documents
|
| 35 |
|
| 36 |
-
def chunk_text(raw_documents):
|
| 37 |
text_splitter = CharacterTextSplitter(chunk_size=chunk_size, chunk_overlap=chunk_overlap)
|
| 38 |
documents = text_splitter.split_documents(raw_documents)
|
| 39 |
return documents
|
|
@@ -82,7 +82,7 @@ def invoke_chain(db, query):
|
|
| 82 |
return answer
|
| 83 |
|
| 84 |
def store_embeddings(pdf_path, chunk_size, chunk_overlap):
|
| 85 |
-
raw_documents = extract_text_from_pdf(pdf_path)
|
| 86 |
|
| 87 |
documents = chunk_text(raw_documents)
|
| 88 |
|
|
|
|
| 33 |
raw_documents.extend(PyPDFLoader(path).load())
|
| 34 |
return raw_documents
|
| 35 |
|
| 36 |
+
def chunk_text(raw_documents, chunk_size, chunk_overlap):
|
| 37 |
text_splitter = CharacterTextSplitter(chunk_size=chunk_size, chunk_overlap=chunk_overlap)
|
| 38 |
documents = text_splitter.split_documents(raw_documents)
|
| 39 |
return documents
|
|
|
|
| 82 |
return answer
|
| 83 |
|
| 84 |
def store_embeddings(pdf_path, chunk_size, chunk_overlap):
|
| 85 |
+
raw_documents = extract_text_from_pdf(pdf_path, chunk_size, chunk_overlap)
|
| 86 |
|
| 87 |
documents = chunk_text(raw_documents)
|
| 88 |
|