mirror of
https://github.com/imartinez/privateGPT.git
synced 2025-07-31 07:05:02 +00:00
Merge 9dfab80598
into b7ee43788d
This commit is contained in:
commit
f17c8e69ca
@ -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:
|
||||||
|
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user