Hi! The attention mask is made so that it accepts 0s and 1s. Putting a 1 indicates that this token should be attended to, while putting a 0 indicates a value that should not be attended to.
In the models it is modified here 25 (inversion 20), which means that tokens that have a 1 value will now have 0, and tokens that have a 0 value will now have -10000.
This value is then summed to the attention scores here 7: if tokens had 1 initially, nothing changes. If tokens has 0 initially, their attention scores becomes a very negative value, nullifying their impact on the sequence.
Unfortunately, you won’t be able to use this attention mask to assign fix weights to certain tokens. The attention_mask can be used to nullify the impact of certain tokens on the rest of the sequence, but that’s about it.