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
Hello, how can I pass in attention_mask that has one more dimension than input_ids, for example: output = peft_model.generate(input_ids,attention_mask=attention_mask,max_new_tokens=100) The input_ids dimension is [bitch_size,N], and the attention_mask dimension is [bitch_size,N,N].
Under this condition, when the above line of code is run, the following error will be reported:
File "/root/anaconda3/lib/python3.10/site-packages/transformers/modeling_attn_mask_utils.py", line 179, in _expand_mask bsz, src_len = mask.size()
ValueError: too many values to unpack (expected 2)
Who can help?
No response
Information
The official example scripts
My own modified scripts
Tasks
An officially supported task in the examples folder
Would it be possible for you to provide a complete code to reproduce the error, the given snippet is not enough. The model doesn't need to be trained, just ensure to configure the same PEFT method as in your initial problem.
System Info
Hello, how can I pass in
attention_mask
that has one more dimension thaninput_ids
, for example:output = peft_model.generate(input_ids,attention_mask=attention_mask,max_new_tokens=100)
Theinput_ids
dimension is [bitch_size,N], and theattention_mask
dimension is [bitch_size,N,N].Under this condition, when the above line of code is run, the following error will be reported:
File "/root/anaconda3/lib/python3.10/site-packages/transformers/modeling_attn_mask_utils.py", line 179, in _expand_mask bsz, src_len = mask.size()
ValueError: too many values to unpack (expected 2)
Who can help?
No response
Information
Tasks
examples
folderReproduction
`
Expected behavior
Read the model for fine-tuning and reasoning.
The text was updated successfully, but these errors were encountered: