mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-30 17:52:35 +06: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
7aee036e54
commit
ed98ad35e6
@ -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 New Issue
Block a user