Skip to content

Commit

Permalink
fix: ensure UTF-8 encoding when reading text files in ingestion helper
Browse files Browse the repository at this point in the history
  • Loading branch information
akshayjalluri6 committed Jan 23, 2025
1 parent b7ee437 commit b77f90e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion private_gpt/components/ingest/ingest_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def _load_file_to_documents(file_name: str, file_data: Path) -> list[Document]:
)
# Read as a plain text
string_reader = StringIterableReader()
return string_reader.load_data([file_data.read_text()])
return string_reader.load_data([file_data.read_text(encoding="utf8")])

logger.debug("Specific reader found for extension=%s", extension)
documents = reader_cls().load_data(file_data)
Expand Down

0 comments on commit b77f90e

Please sign in to comment.