Fix usage of head masks by TF encoder-decoder models' generate() function (#11775)

* Fix Bart

* Fix Blenderbot{,_small}

* Fix LED

* Fix Marian

* Fix MBart

* Fix Pegasus

* Fix T5

* Add test for generation with head_mask

* Add a common TF test

* Override a test for the LED model as head masking is not yet properly implemented

* Remove all head_masks from input preparation for LED

* Drop masking for T5 as it needs a bit of refactor
This commit is contained in:
Daniel Stancl
2021-05-26 15:02:44 +02:00
committed by GitHub
parent 0b0a598452
commit 0b93358447
11 changed files with 84 additions and 2 deletions

View File

@@ -370,6 +370,10 @@ class TFLEDModelTest(TFModelTesterMixin, unittest.TestCase):
# This test is too long (>30sec) and makes fail the CI
pass
def test_generate_with_headmasking(self):
# TODO: Head-masking not yet implement
pass
def _assert_tensors_equal(a, b, atol=1e-12, prefix=""):
"""If tensors not close, or a and b arent both tensors, raise a nice Assertion error."""