From c932087997456bdbb4c07661aaa648dd861263f1 Mon Sep 17 00:00:00 2001 From: Gull Man Date: Wed, 12 Apr 2023 12:13:18 +0200 Subject: [PATCH 1/2] add encoding to open file --- scripts/file_operations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/file_operations.py b/scripts/file_operations.py index c6066ef9..59b3a0d0 100644 --- a/scripts/file_operations.py +++ b/scripts/file_operations.py @@ -38,7 +38,7 @@ def write_to_file(filename, text): directory = os.path.dirname(filepath) if not os.path.exists(directory): os.makedirs(directory) - with open(filepath, "w") as f: + with open(filepath, "w", encoding='utf-8') as f: f.write(text) return "File written to successfully." except Exception as e: From dd15900804ea502fdca76077ea7bc30ebfaaa476 Mon Sep 17 00:00:00 2001 From: Yossi Marouani Date: Thu, 13 Apr 2023 17:19:02 +0300 Subject: [PATCH 2/2] temperature should not be an Int. it can be any value between 0-1 --- scripts/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/config.py b/scripts/config.py index ebf1b08b..8cbc67fc 100644 --- a/scripts/config.py +++ b/scripts/config.py @@ -44,7 +44,7 @@ class Config(metaclass=Singleton): self.smart_token_limit = int(os.getenv("SMART_TOKEN_LIMIT", 8000)) self.openai_api_key = os.getenv("OPENAI_API_KEY") - self.temperature = int(os.getenv("TEMPERATURE", "1")) + self.temperature = float(os.getenv("TEMPERATURE", "1")) self.use_azure = False self.use_azure = os.getenv("USE_AZURE") == 'True' self.execute_local_commands = os.getenv('EXECUTE_LOCAL_COMMANDS', 'False') == 'True'