Unverified Commit 6af3306a authored by Lorenzo Ampil's avatar Lorenzo Ampil Committed by GitHub
Browse files

Add decoder specific error message for T5Stack.forward (#4128)

parent 1cdd2ad2
...@@ -665,6 +665,9 @@ class T5Stack(T5PreTrainedModel): ...@@ -665,6 +665,9 @@ class T5Stack(T5PreTrainedModel):
input_ids = input_ids.view(-1, input_shape[-1]) input_ids = input_ids.view(-1, input_shape[-1])
elif inputs_embeds is not None: elif inputs_embeds is not None:
input_shape = inputs_embeds.size()[:-1] input_shape = inputs_embeds.size()[:-1]
else:
if self.is_decoder:
raise ValueError("You have to specify either decoder_input_ids or decoder_inputs_embeds")
else: else:
raise ValueError("You have to specify either input_ids or inputs_embeds") raise ValueError("You have to specify either input_ids or inputs_embeds")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment