allenai / allenai/longformer

I am not able to set global attention mask. I have although given two sep tokens between question and context

Abierto
#97 7 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
2.2k
Forks
286
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

outputs = model(**inputs)
File "C:\Users\Rudraksh\Anaconda3\envs\bert_pre\lib\site-packages\torch\nn\modules\module.py", line 547, in __call__
result = self.forward(*input, **kwargs)
File "d:\transformers\src\transformers\modeling_longformer.py", line 1345, in forward
global_attention_mask = _compute_global_attention_mask(input_ids, self.config.sep_token_id)
File "d:\transformers\src\transformers\modeling_longformer.py", line 84, in _compute_global_attention_mask
question_end_index = _get_question_end_index(input_ids, sep_token_id)
File "d:\transformers\src\transformers\modeling_longformer.py", line 73, in _get_question_end_index
), f"There should be exactly three separator tokens: {sep_token_id} in every sample for questions answering. You might also consider to set `global_attention_mask` manually in the forward function to avoid this error."
AssertionError: There should be exactly three separator tokens: 2 in every sample for questions answering. You might also consider to set `global_attention_mask` manually in the forward function to avoid this error.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.