This commit is contained in:
Omar Trigui 2024-12-15 15:25:38 +00:00 committed by GitHub
commit f17c8e69ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -73,13 +73,13 @@ class IngestionHelper:
) -> list[Document]: ) -> list[Document]:
documents = IngestionHelper._load_file_to_documents(file_name, file_data) documents = IngestionHelper._load_file_to_documents(file_name, file_data)
for document in documents: for document in documents:
document.metadata["file_name"] = file_name document.metadata["file_name"] = str(file_data)
IngestionHelper._exclude_metadata(documents) IngestionHelper._exclude_metadata(documents)
return documents return documents
@staticmethod @staticmethod
def _load_file_to_documents(file_name: str, file_data: Path) -> list[Document]: def _load_file_to_documents(file_name: str, file_data: Path) -> list[Document]:
logger.debug("Transforming file_name=%s into documents", file_name) logger.debug("Transforming file=%s into documents", str(file_data))
extension = Path(file_name).suffix extension = Path(file_name).suffix
reader_cls = FILE_READER_CLS.get(extension) reader_cls = FILE_READER_CLS.get(extension)
if reader_cls is None: if reader_cls is None:

View File

@ -414,7 +414,7 @@ class PrivateGptUi:
) )
ingested_dataset = gr.List( ingested_dataset = gr.List(
self._list_ingested_files, self._list_ingested_files,
headers=["File name"], headers=["Files"],
label="Ingested Files", label="Ingested Files",
height=235, height=235,
interactive=False, interactive=False,