You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 are likely to be ignored.
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.
The text was updated successfully, but these errors were encountered: