Encoding utf-8, bug fix

This commit is contained in:
AjaySi
2024-04-12 18:46:42 +05:30
parent e3c3c03729
commit bdab2e9959
4 changed files with 4 additions and 4 deletions

View File

@@ -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")

View File

@@ -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:

View File

@@ -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}")

View File

@@ -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')