You’re using code aimed at transformers v4 with a previous version so it doesn’t work
You can either:
- upgrade your installation
- replace the line defining your model by this:
model = AutoModelForQuestionAnswering.from_pretrained("bert-large-uncased-whole-word-masking-finetuned-squad", return_dict=True)