The question-answering example in the doc throws an AttributeError exception. Please help

You’re using code aimed at transformers v4 with a previous version so it doesn’t work :slight_smile:
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)