simpletransformers
simpletransformers copied to clipboard
lazy_qa.py not working
Describe the bug lazy_qa.py not working rises an error "TypeError: squad_convert_example_to_features() missing 1 required positional argument: 'is_training' "
same issue, here is my current system and procedure to produce this error
Ubuntu 20.04 with python 3.8.10
pip install simpletransformers pip install wandb pip install pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu
python3 lazy_qa.py
TypeError: squad_convert_example_to_features() missing 1 required positional argument: 'is_training'
Hi, In my case I fixed this by:
- lines 2059 - 2065, in
question_answering_utils.py
f = squad_convert_example_to_features(
example,
self.args.max_seq_length,
self.args.doc_stride,
self.args.max_query_length,
True,
)[0]
Change to
f = squad_convert_example_to_features(
example,
self.args.max_seq_length,
self.args.doc_stride,
self.args.max_query_length,
is_training = True, ###ADD
padding_strategy = "max_length", ###ADD
)[0]
Thanks a lot!
On Wed, Jan 18, 2023 at 4:34 PM Nguyễn Quang Sang @.***> wrote:
Hi, In my case I fixed this by:
- lines 2059 - 2065, in question_answering_utils.py
f = squad_convert_example_to_features( example, self.args.max_seq_length, self.args.doc_stride, self.args.max_query_length, True, )[0]
Change to
f = squad_convert_example_to_features( example, self.args.max_seq_length, self.args.doc_stride, self.args.max_query_length, is_training = True, ###ADD padding_strategy = "max_length", ###ADD )[0]
— Reply to this email directly, view it on GitHub https://github.com/ThilinaRajapakse/simpletransformers/issues/1462#issuecomment-1386673025, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHGZCZX5R66XM57X7OUHFLTWS6TJNANCNFSM6AAAAAAQ6LP6FQ . You are receiving this because you commented.Message ID: @.***>
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.