Patrick von Platen
4dc65591b5
[Almost all TF models] TF clean up: add missing CLM / MLM loss; fix T5 naming and keras compile ( #5395 )
...
* add first version of clm tf
* make style
* add more tests for bert
* update tf clm loss
* fix tests
* correct tf ner script
* add mlm loss
* delete bogus file
* clean tf auto model + add tests
* finish adding clm loss everywhere
* fix training in distilbert
* fix flake8
* save intermediate
* fix tf t5 naming
* remove prints
* finish up
* up
* fix tf gpt2
* fix new test utils import
* fix flake8
* keep backward compatibility
* Update src/transformers/modeling_tf_albert.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Update src/transformers/modeling_tf_auto.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Update src/transformers/modeling_tf_electra.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Update src/transformers/modeling_tf_roberta.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Update src/transformers/modeling_tf_mobilebert.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Update src/transformers/modeling_tf_auto.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Update src/transformers/modeling_tf_bert.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Update src/transformers/modeling_tf_distilbert.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* apply sylvains suggestions
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2020-07-07 18:15:53 +02:00
Sam Shleifer
13deb95a40
Move tests/utils.py -> transformers/testing_utils.py ( #5350 )
2020-07-01 10:31:17 -04:00
Lysandre Debut
cf10d4cfdd
Cleaning TensorFlow models ( #5229 )
...
* Cleaning TensorFlow models
Update all classes
stylr
* Don't average loss
2020-06-24 11:37:20 -04:00
Deniz
32e94cff64
tf add resize_token_embeddings method ( #4351 )
...
* resize token embeddings
* add tokens
* add tokens
* add tokens
* add t5 token method
* add t5 token method
* add t5 token method
* typo
* debugging input
* debugging input
* debug
* debug
* debug
* trying to set embedding tokens properly
* set embeddings for generation head too
* set embeddings for generation head too
* debugging
* debugging
* enable generation
* add base method
* add base method
* add base method
* return logits in the main call
* reverting to generation
* revert back
* set embeddings for the bert main layer
* description
* fix conflicts
* logging
* set base model as self
* refactor
* tf_bert add method
* tf_bert add method
* tf_bert add method
* tf_bert add method
* tf_bert add method
* tf_bert add method
* tf_bert add method
* tf_bert add method
* v0
* v0
* finalize
* final
* black
* add tests
* revert back the emb call
* comments
* comments
* add the second test
* add vocab size condig
* add tf models
* add tf models. add common tests
* remove model specific embedding tests
* stylish
* remove files
* stylez
* Update src/transformers/modeling_tf_transfo_xl.py
change the error.
Co-authored-by: Lysandre Debut <lysandre@huggingface.co>
* adding unchanged weight test
Co-authored-by: Lysandre Debut <lysandre@huggingface.co>
2020-06-18 18:41:26 -04:00
Amil Khare
c852036b4a
[cleanup] Hoist ModelTester objects to top level ( #4939 )
...
Co-authored-by: Sam Shleifer <sshleifer@gmail.com>
2020-06-16 08:03:43 -04:00
Julien Chaumond
d4c2cb402d
Kill model archive maps ( #4636 )
...
* Kill model archive maps
* Fixup
* Also kill model_archive_map for MaskedBertPreTrainedModel
* Unhook config_archive_map
* Tokenizers: align with model id changes
* make style && make quality
* Fix CI
2020-06-02 09:39:33 -04:00
Julien Chaumond
f54dc3f4d5
[ci] Load pretrained models into the default (long-lived) cache
...
There's an inconsistency right now where:
- we load some models into CACHE_DIR
- and some models in the default cache
- and often, in both for the same models
When running the RUN_SLOW tests, this takes a lot of disk space, time, and bandwidth.
I'd rather always use the default cache
2020-04-30 22:30:15 -04:00
Lysandre
875c4ae48f
Definitive HeisenDistilBug fix
...
cc @julien-c @@thomwolf
2020-01-27 12:09:58 -05:00
alberduris
81d6841b4b
GPU text generation: mMoved the encoded_prompt to correct device
2020-01-06 15:11:12 +01:00
alberduris
dd4df80f0b
Moved the encoded_prompts to correct device
2020-01-06 15:11:12 +01:00
Aymeric Augustin
c824d15aa1
Remove __future__ imports.
2019-12-22 17:47:54 +01:00
Aymeric Augustin
345c23a60f
Replace (TF)CommonTestCases for modeling with a mixin.
...
I suspect the wrapper classes were created in order to prevent the
abstract base class (TF)CommonModelTester from being included in test
discovery and running, because that would fail.
I solved this by replacing the abstract base class with a mixin.
Code changes are just de-indenting and automatic reformattings
performed by black to use the extra line space.
2019-12-22 15:35:18 +01:00
Aymeric Augustin
7e98e211f0
Remove unittest.main() in test modules.
...
This construct isn't used anymore these days.
Running python tests/test_foo.py puts the tests/ directory on
PYTHONPATH, which isn't representative of how we run tests.
Use python -m unittest tests/test_foo.py instead.
2019-12-22 14:42:03 +01:00
Aymeric Augustin
ced0a94204
Switch test files to the standard test_*.py scheme.
2019-12-22 14:15:13 +01:00