Update app.py
Browse files
app.py
CHANGED
@@ -75,6 +75,7 @@ def load_single_document(file_path: str) -> Document:
|
|
75 |
assert ext in LOADER_MAPPING
|
76 |
loader_class, loader_args = LOADER_MAPPING[ext]
|
77 |
loader = loader_class(file_path, **loader_args)
|
|
|
78 |
return loader.load()[0]
|
79 |
|
80 |
|
@@ -107,6 +108,7 @@ def process_text(text):
|
|
107 |
|
108 |
def build_index(file_paths, db, chunk_size, chunk_overlap, file_warning):
|
109 |
documents = [load_single_document(path) for path in file_paths]
|
|
|
110 |
text_splitter = RecursiveCharacterTextSplitter(chunk_size=chunk_size, chunk_overlap=chunk_overlap)
|
111 |
documents = text_splitter.split_documents(documents)
|
112 |
fixed_documents = []
|
|
|
75 |
assert ext in LOADER_MAPPING
|
76 |
loader_class, loader_args = LOADER_MAPPING[ext]
|
77 |
loader = loader_class(file_path, **loader_args)
|
78 |
+
print("load_single documernt, return type is: ", type(loader.load()[0]))
|
79 |
return loader.load()[0]
|
80 |
|
81 |
|
|
|
108 |
|
109 |
def build_index(file_paths, db, chunk_size, chunk_overlap, file_warning):
|
110 |
documents = [load_single_document(path) for path in file_paths]
|
111 |
+
print("build_index, documents type is :", type(documents))
|
112 |
text_splitter = RecursiveCharacterTextSplitter(chunk_size=chunk_size, chunk_overlap=chunk_overlap)
|
113 |
documents = text_splitter.split_documents(documents)
|
114 |
fixed_documents = []
|