allenai / allenai/longformer

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

Offen
#97 7 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
2.2k
Forks
286
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.