mirror of
https://github.com/saymrwulf/transformers.git
synced 2026-05-14 20:58:08 +00:00
Fix usage of unpad_input function (#35925)
Fix usage of unpad_function
See https://github.com/huggingface/transformers/issues/35899
In the [commit](cdbbe844b1) return type of `unpad_input` was changed.
Now the code support older and newer versions
Co-authored-by: Pavel Gein <pavel.gein@gmail.com>
This commit is contained in:
parent
d68779b358
commit
1bfcddbba7
1 changed files with 1 additions and 1 deletions
|
|
@ -121,7 +121,7 @@ def _upad_input(
|
|||
else:
|
||||
# The -q_len: slice assumes left padding.
|
||||
attention_mask = attention_mask[:, -query_length:]
|
||||
query_layer, indices_q, cu_seqlens_q, max_seqlen_in_batch_q = unpad_input(query_layer, attention_mask)
|
||||
query_layer, indices_q, cu_seqlens_q, max_seqlen_in_batch_q, *_ = unpad_input(query_layer, attention_mask)
|
||||
|
||||
return (
|
||||
query_layer,
|
||||
|
|
|
|||
Loading…
Reference in a new issue