Commit Graph
9 Commits
Author SHA1 Message Date
Rémi Louf 0752069617 adapt attention masks for the decoder case
The introduction of a decoder introduces 2 changes:
- We need to be able to specify a separate mask in the cross
attention to mask the positions corresponding to padding tokens in the
encoder state.
- The self-attention in the decoder needs to be causal on top of not
attending to padding tokens.
2019-10-16 16:12:22 +02:00
Rémi Louf c5a94a6100 fix function that defines masks in XLM
the definition of `get_masks` would blow with the proper combination of
arguments. It was just a matter of moving a definition outside of a
control structure.
2019-10-16 13:00:32 +02:00
Rémi Louf 488a664151 add is_decoder attribute to PretrainedConfig
We currenctly instantiate encoders and decoders for the seq2seq by
passing the `is_decoder` keyword argument to the `from_pretrained`
classmethod. On the other hand, the model class looks for the value
of the `is_decoder` attribute in its config.

In order for the value to propagate from the kwarg to the configuration
we simply need to define `is_decoder` as an attribute to the base
`PretrainedConfig`, with a default at `False`.
2019-10-15 21:03:32 +02:00
Rémi Louf 4c81960b9b comment the seq2seq functions 2019-10-15 20:52:28 +02:00
Rémi Louf 6d6c326737 take path to pretrained for encoder and decoder for init 2019-10-15 16:08:27 +02:00
Rémi Louf 0d81fc853e specify in readme that both datasets are required 2019-10-15 15:26:33 +02:00
Rémi Louf 19e9964780 remove Bert2Bert from module declaration 2019-10-15 15:20:28 +02:00
Rémi Louf 1aec940587 test the full story processing 2019-10-15 15:18:07 +02:00
Rémi Louf 22e1af6859 truncation function is fully tested 2019-10-15 14:43:50 +02:00