I really don’t get the thing very well, but I’ve noticed that preferably you have to set:
model = AutoModelForQuestionAnswering.from_pretrained(model_name)
instead of:
model = AutoModel.from_pretrained(model_name)
as I’ve done in the text above.