BeachWang / DAIL-SQL

A efficient and effective few-shot NL2SQL method on GPT-4.
Apache License 2.0
427 stars 69 forks source link

Error when running generate_question.py #43

Closed SunRise-Star closed 2 months ago

SunRise-Star commented 2 months ago

run generate question with EUCDISMASKPRESKLSIMTHR Run command:python generate_question.py --data_type spider --split test --tokenizer gpt-3.5-turbo --max_seq_len 4096 --selector_type EUCDISMASKPRESKLSIMTHR --pre_test_result ./dataset/process/SPIDER-TEST_SQL_9-SHOT_EUCDISQUESTIONMASK_QA-EXAMPLE_CTX-200_ANS-4096/RESULTS_MODEL-qwen.txt --prompt_repr SQL --k_shot 9 --example_type QA

error: Traceback (most recent call last): File "/root/textToCode/DAIL-SQL/generate_question.py", line 84, in for question_json in tqdm(getattr(data, func_name)()): File "/root/textToCode/DAIL-SQL/utils/data_builder.py", line 122, in get_test_json pre_queries = self.get_pre_skeleton(queries, schemas, mini_set) File "/root/textToCode/DAIL-SQL/utils/data_builder.py", line 86, in get_pre_skeleton skeletons.append(sql2skeleton(query, schema)) File "/root/textToCode/DAIL-SQL/utils/utils.py", line 316, in sql2skeleton sql = sql_normalization(sql) File "/root/textToCode/DAIL-SQL/utils/utils.py", line 312, in sql_normalization return processing_func(sql.strip()) File "/root/textToCode/DAIL-SQL/utils/utils.py", line 310, in processing_func = lambda x: remove_table_alias(add_asc(lower(white_space_fix(double2single(remove_semicolon(x)))))) File "/root/textToCode/DAIL-SQL/utils/utils.py", line 189, in white_space_fix ls = [token.value for token in parsed_s.tokens] File "/root/anaconda3/envs/t2s/lib/python3.10/site-packages/sql_metadata/parser.py", line 169, in tokens self._determine_closing_parenthesis_type(token=token) File "/root/anaconda3/envs/t2s/lib/python3.10/site-packages/sql_metadata/parser.py", line 903, in _determine_closing_parenthesis_type last_open_parenthesis = self._open_parentheses.pop(-1) IndexError: pop from empty list error