In the forward method of the MplugOwlForConditionalGeneration model, there are three mask arguments are optional: non_padding_mask, non_media_mask, prompt_mask. These masks will be used to get loss mask, but your code has no additional process while them passed with None. And your generate method has been rewritten without invoking forward, thus this error would not happened.
Like this, if masks were None, this method raises None Exception directly.
See line at: https://github.com/X-PLUG/mPLUG-Owl/blob/main/mplug_owl/modeling_mplug_owl.py#L1448C9-L1448C25
In the
forward
method of theMplugOwlForConditionalGeneration
model, there are three mask arguments are optional:non_padding_mask
,non_media_mask
,prompt_mask
. These masks will be used to get loss mask, but your code has no additional process while them passed withNone
. And yourgenerate
method has been rewritten without invokingforward
, thus this error would not happened.Like this, if masks were
None
, this method raisesNone Exception
directly.