From 567d4794beb9eba6404ee72956ac5eda68d2fb9e Mon Sep 17 00:00:00 2001 From: Omar Trigui Date: Wed, 3 Apr 2024 10:02:17 +0200 Subject: [PATCH 1/2] Show ingested file paths instead of file names --- private_gpt/components/ingest/ingest_helper.py | 2 +- private_gpt/ui/ui.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/private_gpt/components/ingest/ingest_helper.py b/private_gpt/components/ingest/ingest_helper.py index a11090702..b5b9755f1 100644 --- a/private_gpt/components/ingest/ingest_helper.py +++ b/private_gpt/components/ingest/ingest_helper.py @@ -73,7 +73,7 @@ def transform_file_into_documents( ) -> list[Document]: documents = IngestionHelper._load_file_to_documents(file_name, file_data) for document in documents: - document.metadata["file_name"] = file_name + document.metadata["file_name"] = str(file_data) IngestionHelper._exclude_metadata(documents) return documents diff --git a/private_gpt/ui/ui.py b/private_gpt/ui/ui.py index 4206f6533..502f5e753 100644 --- a/private_gpt/ui/ui.py +++ b/private_gpt/ui/ui.py @@ -334,7 +334,7 @@ def _build_ui_blocks(self) -> gr.Blocks: ) ingested_dataset = gr.List( self._list_ingested_files, - headers=["File name"], + headers=["Files"], label="Ingested Files", height=235, interactive=False, From 9dfab8059816c8ead8bc08e86c01de6460cb90a1 Mon Sep 17 00:00:00 2001 From: Omar Trigui Date: Wed, 3 Apr 2024 18:06:08 +0200 Subject: [PATCH 2/2] ingest_helper.py > debug/log file path instead of file name --- private_gpt/components/ingest/ingest_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/private_gpt/components/ingest/ingest_helper.py b/private_gpt/components/ingest/ingest_helper.py index b5b9755f1..55f72e349 100644 --- a/private_gpt/components/ingest/ingest_helper.py +++ b/private_gpt/components/ingest/ingest_helper.py @@ -79,7 +79,7 @@ def transform_file_into_documents( @staticmethod 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 reader_cls = FILE_READER_CLS.get(extension) if reader_cls is None: