mirror of
https://github.com/ParisNeo/lollms.git
synced 2025-02-01 08:48:19 +00:00
forced the encoding to be utf-8
This commit is contained in:
parent
cf7c1e2d88
commit
12c49a1ef3
@ -165,7 +165,7 @@ def start_writing_story(
|
|||||||
llm.step_end(f'Building section: {section["section_name"]}')
|
llm.step_end(f'Building section: {section["section_name"]}')
|
||||||
|
|
||||||
details = story_path.with_suffix(".json")
|
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:
|
if build_latex:
|
||||||
llm.step_start("Building latex file")
|
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)
|
illustration = build_section_illustration(llm, prompt_ideas, current_section, content, client)
|
||||||
new_section += "\n" + illustration
|
new_section += "\n" + illustration
|
||||||
# Write the new section to the story file
|
# 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
|
return new_section
|
||||||
|
|
||||||
@ -327,7 +327,7 @@ def write_story_section(
|
|||||||
new_section += "\n" + illustration
|
new_section += "\n" + illustration
|
||||||
|
|
||||||
# Append the new section to the story file
|
# 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
|
return new_section
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user