gmichalo / UmlsBERT

MIT License
94 stars 16 forks source link

Error with the input arguments for `HfArgumentParser ` #12

Open LT-LUI opened 1 year ago

LT-LUI commented 1 year ago

Hi,

Thank you very much for providing the code.

But when I ran this command, python3 run_glue.py --output_dir ./models/medicalBert-v1 --model_name_or_path ../checkpoint/umlsbert --data_dir dataset/mednli/mednli --num_train_epochs 3 --per_device_train_batch_size 32 --learning_rate 1e-4 --do_train --do_eval --do_predict --task_name mnli --umls --med_document ./voc/vocab_updated.txt

I got the following error.

  File "/home/UmlsBERT-master/text-classification/run_glue.py", line 300, in <module>
    main()
  File "/home/UmlsBERT-master/text-classification/run_glue.py", line 78, in main
    parser = HfArgumentParser((ModelArguments, DataTrainingArguments, TrainingArguments))
  File "/home/UmlsBERT-master/text-classification/../src/transformers/hf_argparser.py", line 40, in __init__
    self._add_dataclass_arguments(dtype)
  File "/home/UmlsBERT-master/text-classification/../src/transformers/hf_argparser.py", line 72, in _add_dataclass_arguments
    elif hasattr(field.type, "__origin__") and issubclass(field.type.__origin__, List):
  File "/home/lui/anaconda3/lib/python3.9/typing.py", line 852, in __subclasscheck__
    return issubclass(cls, self.__origin__)
TypeError: issubclass() arg 1 must be a class

Perhaps the objects "ModelArguments, DataTrainingArguments, TrainingArguments" have not been initialized?

Thank you again!

Lui