Bart: check if decoder_inputs_embeds is set (#13800)
In BartForConditionalGeneration.forward, if labels are provided,
decoder_input_ids are set to the labels shifted to the right.
This is problematic: if decoder_inputs_embeds is also set,
the call to self.model, which eventually gets to BartDecoder.forward,
will raise an error.
The fix is quite simple, similar to what is there already in
BartModel.forward. Mainly, we should not
compute decoder_input_ids if decoder_inputs_embeds is provided.
Co-authored-by:
Silviu Vlad Oprea <silviuvo@amazon.co.uk>
Showing
Please register or sign in to comment