From e7d52f87f025c62a4c667c3d7090224c6181c02a Mon Sep 17 00:00:00 2001 From: LXW <1264174498@qq.com> Date: Mon, 18 Dec 2023 22:07:27 +0800 Subject: [PATCH] (improvement)(python) run.py read files in utf-8 format (#540) Co-authored-by: jolunoluo --- chat/python/services/s2ql/run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chat/python/services/s2ql/run.py b/chat/python/services/s2ql/run.py index e849b8501..89bc548cc 100644 --- a/chat/python/services/s2ql/run.py +++ b/chat/python/services/s2ql/run.py @@ -52,7 +52,7 @@ if text2sql_agent_autoCoT.count_examples()==0: source_dir_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) example_dir_path = os.path.join(source_dir_path, 'few_shot_example') example_json_file = os.path.join(example_dir_path, 's2ql_examplar3_transformed.json') - with open(example_json_file, 'r') as f: + with open(example_json_file, 'r', encoding='utf-8') as f: transformed_sql_examplar_list = json.load(f) transformed_sql_examplar_ids = [str(i) for i in range(0, len(transformed_sql_examplar_list))]