'list' object has no attribute 'tolist error while using 'deepset/xlm-roberta-large-squad2'
Hi there,

I am using 'deepset/xlm-roberta-large-squad2' for Question Answering prediction on my own dataset using transformers QuestionAnsweringPipeline. I get the following error and I can't handle it as it has something to do with 'p_mask' in preprocess(self, example, padding, doc_stride, max_question_len, max_seq_len) in transformers/pipelines/question_answering.py. The error that was thrown is:

AttributeError Traceback (most recent call last)
in ()
7 for i in range(len(qa_df)):
----> 9 prediction = QA_obj.predict_answers(qa_df.loc[i,'Question'], qa_df.loc[i,'ID'], [qa_df.loc[i,'Passage']])
10 all_predictions.append(prediction)
11

4 frames
/usr/local/lib/python3.7/dist-packages/transformers/pipelines/question_answering.py in preprocess(self, example, padding, doc_stride, max_question_len, max_seq_len)
314 attention_mask=attention_mask_span_idx,
315 token_type_ids=token_type_ids_span_idx,
--> 316 p_mask=p_mask[span_idx].tolist(),
317 encoding=encoded_inputs[span_idx],
318 # We don't use the rest of the values - and actually

AttributeError: 'list' object has no attribute 'tolist'

Any help would be much appreciated.
Thanks.

Probably the same error as #13811, cc'ing @Narsil <|||||>Should be fixed by https://github.com/huggingface/transformers/pull/13873 can you confirm ?<|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md) are likely to be ignored.