Skip to content

Commit

Permalink
Encoding utf-8, bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AJaySi committed Apr 12, 2024
1 parent e3c3c03 commit bdab2e9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion alwrity.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def check_llm_environs():
api_key = typer.prompt(f"\n🙆🙆Please enter {api_key_var} API Key:")

# Update .env file
with open(".env", "a") as env_file:
with open(".env", "a", encoding="utf-8") as env_file:
env_file.write(f"GPT_PROVIDER={gpt_provider.lower()}\n")
env_file.write(f"{api_key_var}={api_key}\n")

Expand Down
2 changes: 1 addition & 1 deletion lib/ai_web_researcher/common_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def cfg_search_param(flag):
file_path = Path(__file__).resolve().parents[2] / "main_config"
logger.info(f"Reading search config params from {file_path}")
config = configparser.ConfigParser()
config.read(file_path)
config.read(file_path, encoding="utf-8")
web_research_section = config["web_research"]

if 'serperdev' in flag:
Expand Down
2 changes: 1 addition & 1 deletion lib/blog_postprocessing/blog_proof_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def blog_proof_editor(blog_content):
config_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', 'main_config'))
config = configparser.ConfigParser()
#config = configparser.RawConfigParser()
config.read(config_path, encoding='utf-8-sig')
config.read(config_path, encoding='utf-8')
except Exception as err:
print(f"ProofReader: Failed to read values from config: {err}")

Expand Down
2 changes: 1 addition & 1 deletion lib/gpt_providers/text_generation/main_text_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def read_llm_parameters(config_path: str) -> tuple:
"""
try:
config = configparser.ConfigParser()
config.read(config_path)
config.read(config_path, encoding="utf-8")

gpt_provider = config.get('llm_options', 'gpt_provider')
model = config.get('llm_options', 'model')
Expand Down

0 comments on commit bdab2e9

Please sign in to comment.