awslabs / gap-text2sql

GAP-text2SQL: Learning Contextual Representations for Semantic Parsing with Generation-Augmented Pre-Training
https://arxiv.org/abs/2012.10309
Apache License 2.0
102 stars 25 forks source link

Errors in inference on my table #22

Open xkluan opened 3 years ago

xkluan commented 3 years ago

Hello, I want to know why this error happened? Is this because the table data format or the missing data in table ?

Traceback (most recent call last): File "my_test.py", line 91, in code, ret_v = infer("how much dollar signed in 2021?") File "my_test.py", line 86, in infer output = inferer._infer_one(model, data_item, preproc_data, beam_size=1, use_heuristic=True) File "/Users/Documents/gap-text2sql-main/rat-local-version/seq2struct/commands/infer.py", line 97, in _infer_one model, data_item, preproc_item, beam_size=beam_size, max_steps=1000, from_cond=False) File "/Users/Documents/gap-text2sql-main/rat-local-version/seq2struct/models/spider/spider_beam_search.py", line 21, in beam_search_with_heuristics inference_state, next_choices = model.begin_inference(orig_item, preproc_item) File "/Users/Documents/gap-text2sql-main/rat-local-version/seq2struct/models/enc_dec.py", line 133, in begin_inference enc_state, = self.encoder([enc_input]) File "/Users/anaconda3/envs/chat/lib/python3.6/site-packages/torch/nn/modules/module.py", line 550, in call result = self.forward(*input, **kwargs) File "/Users/Documents/gap-text2sql-main/rat-local-version/seq2struct/models/spider/spider_enc.py", line 1416, in forward padded_token_lists, att_mask_lists, tok_type_lists = self.pad_sequence_for_bert_batch(batch_token_lists) File "/Users/Documents/gap-text2sql-main/rat-local-version/seq2struct/models/spider/spider_enc.py", line 1556, in pad_sequence_for_bert_batch max_len = max([len(it) for it in tokens_lists]) ValueError: max() arg is an empty sequence

Impavidity commented 3 years ago

Have you checkout the notebook here https://github.com/awslabs/gap-text2sql/blob/main/rat-sql-gap/notebook.ipynb ?

If you can provide more details on the implementation of your my_test.py, it would be more helpful.