From 1c363e6d5f4ec7817ceffeeb17bd972b1ce9d9d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=8F=E5=9B=AD=E7=8C=AB?= Date: Sun, 14 May 2023 00:53:54 +0800 Subject: [PATCH] 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 --- rwkv/chat_with_bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rwkv/chat_with_bot.py b/rwkv/chat_with_bot.py index 0ff772b..6ae0ce0 100644 --- a/rwkv/chat_with_bot.py +++ b/rwkv/chat_with_bot.py @@ -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']