simpletransformers icon indicating copy to clipboard operation
simpletransformers copied to clipboard

lazy_qa.py not working

Open birolkuyumcu opened this issue 2 years ago • 4 comments

Describe the bug lazy_qa.py not working rises an error "TypeError: squad_convert_example_to_features() missing 1 required positional argument: 'is_training' "

birolkuyumcu avatar Oct 06 '22 08:10 birolkuyumcu

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'

AKOBIBILI avatar Jan 13 '23 15:01 AKOBIBILI

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]

ngwgsang avatar Jan 18 '23 08:01 ngwgsang

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: @.***>

AKOBIBILI avatar Jan 18 '23 09:01 AKOBIBILI

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.

stale[bot] avatar Jun 18 '23 06:06 stale[bot]