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
...@@ -666,7 +666,10 @@ class T5Stack(T5PreTrainedModel): ...@@ -666,7 +666,10 @@ class T5Stack(T5PreTrainedModel):
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: else:
raise ValueError("You have to specify either input_ids or inputs_embeds") if self.is_decoder:
raise ValueError("You have to specify either decoder_input_ids or decoder_inputs_embeds")
else:
raise ValueError("You have to specify either input_ids or inputs_embeds")
if inputs_embeds is None: if inputs_embeds is None:
assert self.embed_tokens is not None, "You have to intialize the model with valid token embeddings" assert self.embed_tokens is not None, "You have to intialize the model with valid token embeddings"
......
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