[Use cache] Align logic of use_cache with output_attentions and output_hidden_states (#5194)

* fix use cache

* add bart use cache

* fix bart

* finish bart
This commit is contained in:
Patrick von Platen
2020-06-24 16:09:17 +02:00
committed by GitHub
parent 64c393ee74
commit c2a26ec8a6
13 changed files with 90 additions and 21 deletions

View File

@@ -126,6 +126,7 @@ class TFModelTesterMixin:
if "T5" in main_layer_class.__name__:
# Take the same values than in TFT5ModelTester for this shared layer
shared = TFSharedEmbeddings(99, 32, name="shared")
config.use_cache = False
main_layer = main_layer_class(config, embed_tokens=shared)
else:
main_layer = main_layer_class(config)