Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display ingested file paths instead of file names #1825

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions private_gpt/components/ingest/ingest_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ 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

@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:
Expand Down
2 changes: 1 addition & 1 deletion private_gpt/ui/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down