From b77f90e177dac473ca1dad0a173f84574c090fe0 Mon Sep 17 00:00:00 2001 From: Akshay Jalluri Date: Thu, 23 Jan 2025 14:42:21 +0530 Subject: [PATCH] fix: ensure UTF-8 encoding when reading text files in ingestion helper --- 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 da62568b..837bfd59 100644 --- a/private_gpt/components/ingest/ingest_helper.py +++ b/private_gpt/components/ingest/ingest_helper.py @@ -89,7 +89,7 @@ class IngestionHelper: ) # 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)