"'Database' object has no attribute 'get_connection'" errors
Eterance opened this issue ยท 6 comments
Hi, when I run the "wikitq nsql annotation command" with following commands,
cd Binder
export TOKENIZERS_PARALLELISM=false
nohup python scripts/annotate_binder_program.py --dataset wikitq \
--dataset_split test \
--prompt_file templates/prompts/wikitq_binder.txt \
--n_parallel_prompts 1 \
--max_generation_tokens 512 \
--temperature 0.4 \
--sampling_n 20 \
-v \
> run-wikitq-annotation.out 2>&1 &
tail -fn 5000 run-wikitq-annotation.out
(I didn't run run.py
directly, because it reports an error: python: can't open file '/scripts/annotate_binder_program.py': [Errno 2] No such file or directory
)
the console outputs the following message:
I located the code that threw the error:
self.records_conn = self.db.get_connection()
at line 100, nsql/database.py
I haven't completed the test yet, but I'm wondering if this whole bunch of 'Database' object has no attribute 'get_connection'
errors is normal? How should I fix it?
Hi,
Thanks for your question!
It is undoubtedly abnormal to see this error, could you double-check your pip packages about the version of records
? It should be strictly the same as us or throw similar errors as I remembered.
Thanks!
I saw similar things in eguilg/nl2sql#1 when I first met that problem months before, so I record that in our README.md and fix that, you can see this instruction here https://github.com/HKUNLP/Binder#dependencies
records==0.5.3
will save you from struggling and see magic of Binder๐๏ฝ
Sorry, my mistake, I forgot to run pip install records==0.5.3
after creating the environment. ๐ It actually works like magic.
Thanks again for your patience!
Thank you for asking!