Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,7 +37,7 @@ def get_pdf_text(pdf_docs):
|
|
| 37 |
return documents
|
| 38 |
|
| 39 |
@st.cache_data
|
| 40 |
-
def get_text_chunks(
|
| 41 |
"""
|
| 42 |
Splits Document objects into chunks while preserving metadata.
|
| 43 |
"""
|
|
@@ -46,7 +46,7 @@ def get_text_chunks(documents):
|
|
| 46 |
chunk_overlap=200
|
| 47 |
)
|
| 48 |
# split_documents ensures metadata (page num) is copied to new chunks
|
| 49 |
-
chunks = text_splitter.split_documents(
|
| 50 |
return chunks
|
| 51 |
|
| 52 |
# --- Hugging Face Model Functions ---
|
|
|
|
| 37 |
return documents
|
| 38 |
|
| 39 |
@st.cache_data
|
| 40 |
+
def get_text_chunks(_documents):
|
| 41 |
"""
|
| 42 |
Splits Document objects into chunks while preserving metadata.
|
| 43 |
"""
|
|
|
|
| 46 |
chunk_overlap=200
|
| 47 |
)
|
| 48 |
# split_documents ensures metadata (page num) is copied to new chunks
|
| 49 |
+
chunks = text_splitter.split_documents(_documents)
|
| 50 |
return chunks
|
| 51 |
|
| 52 |
# --- Hugging Face Model Functions ---
|