Run_qa crashes because of parser = HfArgumentParser((ModelArguments, DataTrainingArguments, TrainingArguments))
See original GitHub issueEnvironment info
transformers
version: 4.3.3- Platform: linux
- Python version:3.7, 3.8, 3.9 reproed across all three
- PyTorch version (GPU?): 1.7, tried 1.8 with same behavior
- Tensorflow version (GPU?):N/A
- Using GPU in script?: yes
- Using distributed or parallel set-up in script?: Yes 2 gpu
Who can help
Information
Model I am using (Bert, XLNet …): bert-base-uncased
The problem arises when using:
- [ X] the official example scripts: (give details below)
- my own modified scripts: (give details below)
The tasks I am working on is:
- [ X] an official GLUE/SQUaD task: (give the name)
- my own task or dataset: (give details below) SQUAD 1.0
To reproduce
Steps to reproduce the behavior:
- Install clean transformers environment
- run the run_qa.py script with instructions as specified
- crash If you go ahead and create a new environment and install the most recent version of the transformer and try to run the run_qa.py script(SQUAD) it crashes because of a parser issue.
python run_qa.py --model_name_or_path bert-base-uncased --dataset_name squad --do_train --per_device_train_batch_size 8 --learning_rate 3e-5 --max_seq_length 384 --doc_stride 128 --output_dir output --overwrite_output_dir --cache_dir cache --preprocessing_num_workers 4 --seed 42 --num_train_epochs 1 Traceback (most recent call last): File “run_qa.py”, line 1095, in <module> main() File “run_qa.py”, line 902, in main parser = HfArgumentParser((ModelArguments, DataTrainingArguments, TrainingArguments)) File “/home/spacemanidol/miniconda3/envs/sparseml/lib/python3.7/site-packages/transformers/hf_argparser.py”, line 52, in init self._add_dataclass_arguments(dtype) File “/home/spacemanidol/miniconda3/envs/sparseml/lib/python3.7/site-packages/transformers/hf_argparser.py”, line 93, in _add_dataclass_arguments elif hasattr(field.type, “origin”) and issubclass(field.type.origin, List): File “/home/spacemanidol/miniconda3/envs/sparseml/lib/python3.7/typing.py”, line 721, in subclasscheck return issubclass(cls, self.origin) TypeError: issubclass() arg 1 must be a clas
Expected behavior
Run and produce a BERT-QA model
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
Can confirm this works.
no, that was not that error. I tested
run_qa.py
w/ dataclasses on py38 and it didn’t fail.the datasets error was:
AttributeError: module 'typing' has no attribute '_ClassVar'
https://github.com/huggingface/transformers/issues/8638