huggingface/transformers: CTRL, DistilGPT-2, Pytorch TPU, tokenizer enhancements, guideline requirements
Creators
- Thomas Wolf1
- Lysandre Debut2
- Victor SANH1
- Denis
- erenup
- Julien Chaumond2
- Matt
- Grégory Châtel3
- Tim Rault1
- Catalin Voss4
- Fei Wang5
- Malte Pietsch6
- Davide Fiocco
- Stefan Schweter
- dhanajitb
- Jinoo
- Ananya Harsh Jha
- yzy5630
- Yongbo Wang7
- Shijie Wu
- Guillem García Subies
- Weixin Wang
- Zeyao Du
- Chi-Liang, Liu8
- Simon Layton9
- Nikolay Korolev10
- Joel Grus11
- Jade Abbott12
- 1. @huggingface
- 2. Hugging Face
- 3. DisAItek & Intel AI Innovators
- 4. Stanford University
- 5. @ShannonAI
- 6. deepset
- 7. Red Hat
- 8. @ntu-spml-lab @Yoctol
- 9. @NVIDIA
- 10. @JetBrains
- 11. @allenai
- 12. @RetroRabbit
Description
Two new models have been added since release 2.0.
- CTRL (from Salesforce) released with the paper CTRL: A Conditional Transformer Language Model for Controllable Generation, by Nitish Shirish Keskar, Bryan McCann, Lav R. Varshney, Caiming Xiong, Richard Socher. This model has been added to the library by @keskarnitish with the help of @thomwolf.
- DistilGPT-2 (from HuggingFace), as the second distilled model after DistilBERT in version 1.2.0. Released alongside the paper DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter
Several updates have been made to the distillation script, including the possibility to distill GPT-2 and to distill on the SQuAD task. By @VictorSanh.
Pytorch TPU supportThe run_glue.py example script can now run on a Pytorch TPU.
Several example scripts have been improved and refactored to use the full potential of the new tokenizer functions:
run_multiple_choice.pyhas been refactored to includeencode_plusby @julien-c and @erenuprun_lm_finetuning.pyhas been improved with the help of @dennymarcels, @jinoobaek-qz and @LysandreJikrun_glue.pyhas been improved with the help of @brian41005
Enhancements have been made on the tokenizers. Two new methods have been added: get_special_tokens_mask and truncate_sequences.
The former returns a mask indicating which tokens are special tokens in a token list, and which are tokens from the initial sequences. The latter truncate sequences according to a strategy.
Both of those methods are called by the encode_plus method, which itself is called by the encode method. The encode_plus now returns a larger dictionary which holds information about the special tokens, as well as the overflowing tokens.
Thanks to @julien-c, @thomwolf, and @LysandreJik for these additions.
Breaking changesThe two methods
add_special_tokens_single_sequenceandadd_special_tokens_sequence_pairhave been removed. They have been replaced by the single methodbuild_inputs_with_special_tokenswhich has a more comprehensible name and manages both sequence singletons and pairs.The boolean parameter
truncate_first_sequencehas been removed in tokenizers'encodeandencode_plusmethods, being replaced by a strategy in the form of a string: 'longest_first', 'only_second', 'only_first' or 'do_not_truncate' are accepted strategies.When the
encodeorencode_plusmethods are called with a specifiedmax_length, the sequences will now always be truncated or throw an error if overflowing.
New contributing guidelines have been added, alongside library development requirements by @rlouf, the newest member of the HuggingFace team.
Community additions/bug-fixes/improvements- GLUE Processors have been refactored to handle inputs for all tasks coming from the
tensorflow_datasets. This work has been done by @agrinh and @philipp-eisen. - The padding_idx is now correctly initialized to 1 in randomly initialized RoBERTa models. @ikuyamada
- The documentation CSS has been adapted to work on older browsers. @TimYagan
- An addition concerning the management of hidden states has been added to the README by @BramVanroy.
- Integration of TF 2.0 models with other Keras modules @thomwolf
- Past values can be opted-out @thomwolf
Files
huggingface/transformers-v2.1.1.zip
Files
(991.8 kB)
| Name | Size | Download all |
|---|---|---|
|
md5:5cfe789dff7ec16d5c994eea4a97290d
|
991.8 kB | Preview Download |
Additional details
Related works
- Is supplement to
- https://github.com/huggingface/transformers/tree/v2.1.1 (URL)