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

Setting 'max_len_single_sentence' is now deprecated. This value is automatically set up. #10

Open
bhadreshpsavani opened this issue Jan 21, 2021 · 1 comment

Comments

@bhadreshpsavani
Copy link

When running the Training script for SQUAD I was getting the below error.

Traceback (most recent call last):
  File "/media/data2/anaconda/envs/mpnet/bin/fairseq-train", line 33, in <module>
    sys.exit(load_entry_point('fairseq', 'console_scripts', 'fairseq-train')())
  File "/media/data1/bhadresh/MPNet/MPNet/pretraining/fairseq_cli/train.py", line 370, in cli_main
    main(args)
  File "/media/data1/bhadresh/MPNet/MPNet/pretraining/fairseq_cli/train.py", line 47, in main
    task = tasks.setup_task(args)
  File "/media/data1/bhadresh/MPNet/MPNet/pretraining/fairseq/tasks/__init__.py", line 17, in setup_task
    return TASK_REGISTRY[args.task].setup_task(args, **kwargs)
  File "/media/data1/bhadresh/MPNet/MPNet/pretraining/fairseq/tasks/squad2.py", line 104, in setup_task
    return cls(args, dictionary)
  File "/media/data1/bhadresh/MPNet/MPNet/pretraining/fairseq/tasks/squad2.py", line 84, in __init__
    self.tokenizer = SQuADTokenizer(args.bpe_vocab_file, dictionary)
  File "/media/data1/bhadresh/MPNet/MPNet/pretraining/fairseq/tasks/squad2.py", line 42, in __init__
    self.max_len_single_sentence = self.max_len - 2
  File "/media/data2/anaconda/envs/mpnet/lib/python3.8/site-packages/transformers/tokenization_utils_base.py", line 1547, in max_len_single_sentence
    raise ValueError(
ValueError: Setting 'max_len_single_sentence' is now deprecated. This value is automatically set up.

By commenting out line 42 and 43 in file

 self.max_len_single_sentence = self.max_len - 2
 self.max_len_sentences_pair = self.max_len - 3

It resolves but is it fine to do so?

When I run the script, I was getting less F1 score and Exact Match than mentioned in the Paper. I also created an issue for that

@StillKeepTry
Copy link
Contributor

You can try this version for fine-tuning

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