From 12c49a1ef362ed4fd394eeb1013d48b49520620f Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Wed, 5 Jun 2024 01:30:00 +0200 Subject: [PATCH] forced the encoding to be utf-8 --- lollms/functions/story_writing.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lollms/functions/story_writing.py b/lollms/functions/story_writing.py index 3945282..05e6ba0 100644 --- a/lollms/functions/story_writing.py +++ b/lollms/functions/story_writing.py @@ -165,7 +165,7 @@ def start_writing_story( llm.step_end(f'Building section: {section["section_name"]}') details = story_path.with_suffix(".json") - details.write_text(json.dumps(story_plan_with_details, indent=4)) + details.write_text(json.dumps(story_plan_with_details, indent=4), encoding="utf-8") if build_latex: llm.step_start("Building latex file") @@ -274,7 +274,7 @@ def write_story_section( illustration = build_section_illustration(llm, prompt_ideas, current_section, content, client) new_section += "\n" + illustration # Write the new section to the story file - story_path.write_text(new_section) + story_path.write_text(new_section, encoding="utf-8") return new_section @@ -327,7 +327,7 @@ def write_story_section( new_section += "\n" + illustration # Append the new section to the story file - story_path.write_text(story_content + "\n" + new_section) + story_path.write_text(story_content + "\n" + new_section, encoding="utf-8") return new_section except Exception as e: