Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"'Database' object has no attribute 'get_connection'" errors #1

Closed
Eterance opened this issue Nov 27, 2022 · 6 comments
Closed

"'Database' object has no attribute 'get_connection'" errors #1

Eterance opened this issue Nov 27, 2022 · 6 comments

Comments

@Eterance
Copy link

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:
image

I located the code that threw the error:
self.records_conn = self.db.get_connection() at line 100, nsql/database.py

image

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?

@Timothyxxx
Copy link
Member

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!

@Eterance
Copy link
Author

Thank you for your reply!

The version of records in my env is 0.5.2.

It seems that the py3.7binder.yaml file you provided does not mention the version of records. Which version should I install?
image

@Timothyxxx
Copy link
Member

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

@Timothyxxx
Copy link
Member

records==0.5.3 will save you from struggling and see magic of Binder🔗~

@Eterance
Copy link
Author

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!

@Timothyxxx
Copy link
Member

Thank you for asking!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants