Fix encoding issue when loading prompt data (#58)

* Fix encoding issue when loading prompt data

* Update chat_with_bot.py

Fix code style

---------

Co-authored-by: Alex <saharNooby@users.noreply.github.com>
This commit is contained in:
柏园猫 2023-05-14 00:53:54 +08:00 committed by GitHub
parent a3178b20ea
commit 1c363e6d5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ args = parser.parse_args()
script_dir: pathlib.Path = pathlib.Path(os.path.abspath(__file__)).parent
with open(script_dir / 'prompt' / f'{LANGUAGE}-{PROMPT_TYPE}.json', 'r') as json_file:
with open(script_dir / 'prompt' / f'{LANGUAGE}-{PROMPT_TYPE}.json', 'r', encoding='utf8') as json_file:
prompt_data = json.load(json_file)
user, bot, separator, init_prompt = prompt_data['user'], prompt_data['bot'], prompt_data['separator'], prompt_data['prompt']