File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed
src/transformers/models/marian Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -979,16 +979,14 @@ def forward(
979
979
980
980
# retrieve input_ids and inputs_embeds
981
981
if (input_ids is None ) ^ (inputs_embeds is not None ):
982
- raise ValueError ("You cannot specify both decoder_input_ids and decoder_inputs_embeds at the same time " )
982
+ raise ValueError ("You must specify exactly one of input_ids or inputs_embeds " )
983
983
elif input_ids is not None :
984
984
input = input_ids
985
985
input_shape = input .shape
986
986
input_ids = input_ids .view (- 1 , input_shape [- 1 ])
987
987
elif inputs_embeds is not None :
988
988
input_shape = inputs_embeds .size ()[:- 1 ]
989
989
input = inputs_embeds [:, :, - 1 ]
990
- else :
991
- raise ValueError ("You have to specify either decoder_input_ids or decoder_inputs_embeds" )
992
990
993
991
if inputs_embeds is None :
994
992
inputs_embeds = self .embed_tokens (input )
You can’t perform that action at this time.
0 commit comments