transformers/tests
Patrick von Platen fc38d4c86f
Improve special_token_id logic in run_generation.py and add tests (#2885)
* improving generation

* finalized special token behaviour for no_beam_search generation

* solved modeling_utils merge conflict

* solve merge conflicts in modeling_utils.py

* add run_generation improvements from PR #2749

* adapted language generation to not use hardcoded -1 if no padding token is available

* remove the -1 removal as hard coded -1`s are not necessary anymore

* add lightweight language generation testing for randomely initialized models - just checking whether no errors are thrown

* add slow language generation tests for pretrained models using hardcoded output with pytorch seed

* delete ipdb

* check that all generated tokens are valid

* renaming

* renaming Generation -> Generate

* make style

* updated so that generate_beam_search has same token behavior than generate_no_beam_search

* consistent return format for run_generation.py

* deleted pretrain lm generate tests -> will be added in another PR

* cleaning of unused if statements and renaming

* run_generate will always return an iterable

* make style

* consistent renaming

* improve naming, make sure generate function always returns the same tensor, add docstring

* add slow tests for all lmhead models

* make style and improve example comments modeling_utils

* better naming and refactoring in modeling_utils

* improving generation

* finalized special token behaviour for no_beam_search generation

* solved modeling_utils merge conflict

* solve merge conflicts in modeling_utils.py

* add run_generation improvements from PR #2749

* adapted language generation to not use hardcoded -1 if no padding token is available

* remove the -1 removal as hard coded -1`s are not necessary anymore

* add lightweight language generation testing for randomely initialized models - just checking whether no errors are thrown

* add slow language generation tests for pretrained models using hardcoded output with pytorch seed

* delete ipdb

* check that all generated tokens are valid

* renaming

* renaming Generation -> Generate

* make style

* updated so that generate_beam_search has same token behavior than generate_no_beam_search

* consistent return format for run_generation.py

* deleted pretrain lm generate tests -> will be added in another PR

* cleaning of unused if statements and renaming

* run_generate will always return an iterable

* make style

* consistent renaming

* improve naming, make sure generate function always returns the same tensor, add docstring

* add slow tests for all lmhead models

* make style and improve example comments modeling_utils

* better naming and refactoring in modeling_utils

* changed fast random lm generation testing design to more general one

* delete in old testing design in gpt2

* correct old variable name

* temporary fix for encoder_decoder lm generation tests - has to be updated when t5 is fixed

* adapted all fast random generate tests to new design

* better warning description in modeling_utils

* better comment

* better comment and error message

Co-authored-by: Thomas Wolf <thomwolf@users.noreply.github.com>
2020-02-21 12:09:59 -05:00
..
fixtures AutoConfig + other Auto classes honor model_type 2020-01-11 02:46:17 +00:00
__init__.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_activations.py get_activation('relu') provides a simple mapping from strings i… (#2807) 2020-02-13 08:28:33 -05:00
test_configuration_auto.py Map configs to models and tokenizers 2020-01-13 23:11:44 +00:00
test_configuration_common.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_doc_samples.py Rename test_examples to test_doc_samples 2020-01-30 10:07:22 -05:00
test_hf_api.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_model_card.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_modeling_albert.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_modeling_auto.py Flaubert auto tokenizer + tests 2020-01-31 14:16:52 -05:00
test_modeling_bart.py New BartModel (#2745) 2020-02-20 18:11:13 -05:00
test_modeling_bert.py BERT decoder: Fix causal mask dtype. 2020-02-11 15:19:22 -05:00
test_modeling_common.py Improve special_token_id logic in run_generation.py and add tests (#2885) 2020-02-21 12:09:59 -05:00
test_modeling_ctrl.py Improve special_token_id logic in run_generation.py and add tests (#2885) 2020-02-21 12:09:59 -05:00
test_modeling_distilbert.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_modeling_encoder_decoder.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_modeling_flaubert.py Correct slow test 2020-02-04 18:05:35 -05:00
test_modeling_gpt2.py Improve special_token_id logic in run_generation.py and add tests (#2885) 2020-02-21 12:09:59 -05:00
test_modeling_openai.py Improve special_token_id logic in run_generation.py and add tests (#2885) 2020-02-21 12:09:59 -05:00
test_modeling_roberta.py New BartModel (#2745) 2020-02-20 18:11:13 -05:00
test_modeling_t5.py New BartModel (#2745) 2020-02-20 18:11:13 -05:00
test_modeling_tf_albert.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_modeling_tf_auto.py Add AutoModelForPreTraining 2020-01-27 14:27:07 -05:00
test_modeling_tf_bert.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_modeling_tf_common.py Absolute definitive HeisenDistilBug solve 2020-01-27 21:58:36 -05:00
test_modeling_tf_ctrl.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_modeling_tf_distilbert.py Definitive HeisenDistilBug fix 2020-01-27 12:09:58 -05:00
test_modeling_tf_gpt2.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_modeling_tf_openai_gpt.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_modeling_tf_roberta.py RoBERTa TensorFlow Tests 2020-02-04 18:05:35 -05:00
test_modeling_tf_t5.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_modeling_tf_transfo_xl.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_modeling_tf_xlm.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_modeling_tf_xlnet.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_modeling_transfo_xl.py Improve special_token_id logic in run_generation.py and add tests (#2885) 2020-02-21 12:09:59 -05:00
test_modeling_xlm.py Improve special_token_id logic in run_generation.py and add tests (#2885) 2020-02-21 12:09:59 -05:00
test_modeling_xlnet.py Improve special_token_id logic in run_generation.py and add tests (#2885) 2020-02-21 12:09:59 -05:00
test_optimization_tf.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_optimization.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_pipelines.py Integrate fast tokenizers library inside transformers (#2674) 2020-02-19 11:35:40 -05:00
test_tokenization_albert.py 💄 super 2020-01-15 18:33:50 -05:00
test_tokenization_auto.py Integrate fast tokenizers library inside transformers (#2674) 2020-02-19 11:35:40 -05:00
test_tokenization_bert_japanese.py 💄 super 2020-01-15 18:33:50 -05:00
test_tokenization_bert.py Fix BasicTokenizer to respect never_split parameters (#2557) 2020-01-17 14:57:56 -05:00
test_tokenization_common.py Preserve spaces in GPT-2 tokenizers (#2778) 2020-02-13 13:29:43 -05:00
test_tokenization_ctrl.py 💄 super 2020-01-15 18:33:50 -05:00
test_tokenization_distilbert.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_tokenization_fast.py Fast Tokenizers save pretrained should return the list of generated file paths. (#2918) 2020-02-20 00:58:04 +01:00
test_tokenization_gpt2.py 💄 super 2020-01-15 18:33:50 -05:00
test_tokenization_openai.py 💄 super 2020-01-15 18:33:50 -05:00
test_tokenization_roberta.py Preserve spaces in GPT-2 tokenizers (#2778) 2020-02-13 13:29:43 -05:00
test_tokenization_t5.py 💄 super 2020-01-15 18:33:50 -05:00
test_tokenization_transfo_xl.py 💄 super 2020-01-15 18:33:50 -05:00
test_tokenization_utils.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_tokenization_xlm.py 💄 super 2020-01-15 18:33:50 -05:00
test_tokenization_xlnet.py 💄 super 2020-01-15 18:33:50 -05:00
utils.py More AutoConfig tests 2020-01-11 03:43:57 +00:00