Error while using NER model; need assistance
Dear Zhang,
I hope this email finds you well.
I am writing to inform you that I have encountered an issue with your model while performing your NER model, "zhang19991111/scibert-spanmarker-STEM-NER".
Since last Friday (May 24, 2024), I have been unable to complete my calculations, see the error below. Could you please check if there is any problem with your Hugging Face server?
Thank you very much for your assistance.
Best regards,
Wagner Wlysses Araujo
Error below
File ~/anaconda3/envs/ww_scibert_spanmarker/lib/python3.10/site-packages/transformers/modeling_attn_mask_utils.py:439, in _prepare_4d_attention_mask_for_sdpa(mask, dtype, tgt_len)
426 def _prepare_4d_attention_mask_for_sdpa(mask: torch.Tensor, dtype: torch.dtype, tgt_len: Optional[int] = None):
427 """
428 Creates a non-causal 4D mask of shape (batch_size, 1, query_length, key_value_length) from a 2D mask of shape
429 (batch_size, key_value_length)
(...)
437 The target length or query length the created mask shall have.
438 """
--> 439 batch_size, key_value_length = mask.shape
440 tgt_len = tgt_len if tgt_len is not None else key_value_length
442 # torch.jit.trace, symbolic_trace and torchdynamo with fullgraph=True are unable to capture the controlflow is_causal=attention_mask is None and q_len > 1
443 # used as an SDPA argument. We keep compatibility with these tracing tools by always using SDPA's attn_mask argument in case we are tracing.
444 # TODO: For dynamo, rather use a check on fullgraph=True once this is possible (https://github.com/pytorch/pytorch/pull/120400).
ValueError: too many values to unpack (expected 2)