"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "8e13b7359388882d93af5fe312efe56b6556fa23"
Unverified Commit e830495c authored by Thien Tran's avatar Thien Tran Committed by GitHub
Browse files

Fix data2vec-audio note about attention mask (#27116)

fix data2vec audio note about attention mask
parent 16043211
...@@ -786,12 +786,11 @@ DATA2VEC_AUDIO_INPUTS_DOCSTRING = r""" ...@@ -786,12 +786,11 @@ DATA2VEC_AUDIO_INPUTS_DOCSTRING = r"""
<Tip warning={true}> <Tip warning={true}>
`attention_mask` should only be passed if the corresponding processor has `config.return_attention_mask == `attention_mask` should be passed if the corresponding processor has `config.return_attention_mask ==
True`. For all models whose processor has `config.return_attention_mask == False`, such as True`, which is the case for all pre-trained Data2Vec Audio models. Be aware that that even with
[data2vec-audio-base](https://huggingface.co/facebook/data2vec-audio-base-960h), `attention_mask` should `attention_mask`, zero-padded inputs will have slightly different outputs compared to non-padded inputs
**not** be passed to avoid degraded performance when doing batched inference. For such models because there are more than one convolutional layer in the positional encodings. For a more detailed
`input_values` should simply be padded with 0 and passed without `attention_mask`. Be aware that these explanation, see [here](https://github.com/huggingface/transformers/issues/25621#issuecomment-1713759349).
models also yield slightly different results depending on whether `input_values` is padded or not.
</Tip> </Tip>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment