[EncoderDecoderModel] add a add_cross_attention boolean to config (#6377)

* correct encoder decoder model

* Apply suggestions from code review

* apply sylvains suggestions
This commit is contained in:
Patrick von Platen
2020-08-10 19:46:48 +02:00
committed by GitHub
parent 06bc347c97
commit 3425936643
6 changed files with 27 additions and 8 deletions

View File

@@ -176,6 +176,7 @@ class BertModelTester:
encoder_hidden_states,
encoder_attention_mask,
):
config.add_cross_attention = True
model = BertModel(config)
model.to(torch_device)
model.eval()
@@ -235,6 +236,7 @@ class BertModelTester:
encoder_hidden_states,
encoder_attention_mask,
):
config.add_cross_attention = True
model = BertLMHeadModel(config=config)
model.to(torch_device)
model.eval()