- 15 Oct, 2019 3 commits
- 14 Oct, 2019 8 commits
-
-
Rémi Louf authored
-
Rémi Louf authored
-
Rémi Louf authored
the data provided by Li Dong et al. were already tokenized, which means that they are not compatible with all the models in the library. We thus process the raw data directly and tokenize them using the models' tokenizers.
-
Rémi Louf authored
We write a function to load an preprocess the CNN/Daily Mail dataset as provided by Li Dong et al. The issue is that this dataset has already been tokenized by the authors, so we actually need to find the original, plain-text dataset if we want to apply it to all models.
-
thomwolf authored
-
thomwolf authored
-
thomwolf authored
-
thomwolf authored
-
- 11 Oct, 2019 3 commits
-
-
Rémi Louf authored
-
Rémi Louf authored
-
Rémi Louf authored
In Rothe et al.'s "Leveraging Pre-trained Checkpoints for Sequence Generation Tasks", Bert2Bert is initialized with pre-trained weights for the encoder, and only pre-trained embeddings for the decoder. The current version of the code completely randomizes the weights of the decoder. We write a custom function to initiliaze the weights of the decoder; we first initialize the decoder with the weights and then randomize everything but the embeddings.
-
- 10 Oct, 2019 13 commits
-
-
Rémi Louf authored
-
Rémi Louf authored
-
Rémi Louf authored
-
Rémi Louf authored
-
Rémi Louf authored
Since the preloading of weights relies on the name of the class's attributes changing the namespace breaks loading pretrained weights on Bert and all related models. I reverted `self_attention` to `attention` and us `crossattention` for the decoder instead.
-
Rémi Louf authored
-
Rémi Louf authored
-
Rémi Louf authored
-
Rémi Louf authored
-
Rémi Louf authored
-
Rémi Louf authored
-
Rémi Louf authored
In the seq2seq model we need to both load pretrained weights in the encoder and initialize the decoder randomly. Because the `from_pretrained` method defined in the base class relies on module names to assign weights, it would also initialize the decoder with pretrained weights. To avoid this we override the method to only initialize the encoder with pretrained weights.
-
Rémi Louf authored
-
- 08 Oct, 2019 8 commits
-
-
Rémi Louf authored
-
Rémi Louf authored
-
Rémi Louf authored
-
Rémi Louf authored
-
Rémi Louf authored
I am not sure what happens when the class is initialized with the pretrained weights.
-
Rémi Louf authored
-
Rémi Louf authored
The modifications that I introduced in a previous commit did break Bert's internal API. I reverted these changes and added more general classes to handle the encoder-decoder attention case. There may be a more elegant way to deal with retro-compatibility (I am not comfortable with the current state of the code), but I cannot see it right now.
-
Rémi Louf authored
-
- 07 Oct, 2019 5 commits
-
-
Rémi Louf authored
There is currently no way to specify the quey, key and value separately in the Attention module. However, the decoder's "encoder-decoder attention" layers take the decoder's last output as a query, the encoder's states as key and value. We thus modify the existing code so query, key and value can be added separately. This obviously poses some naming conventions; `BertSelfAttention` is not a self-attention module anymore. The way the residual is forwarded is now awkard, etc. We will need to do some refacto once the decoder is fully implemented.
-
Rémi Louf authored
-
Rémi Louf authored
-
Rémi Louf authored
Several packages were imported but never used, indentation and line spaces did not follow PEP8.
-
Rémi Louf authored
-