ValueError: If no `decoder_input_ids` or `decoder_inputs_embeds` are passed, `input_ids` cannot be `None`

#75
by dutta18 - opened

I am trying to get the decoder hidden state of the florence 2 model. I was following this https://huggingface.co/microsoft/Florence-2-large/blob/main/modeling_florence2.py to understand the parameters that goes into the forward method. I tried something like

Pass inputs to the model with output_hidden_states=True to get hidden states

with torch.no_grad():
outputs = model(
input_ids=inputs["input_ids"],
pixel_values=inputs["pixel_values"],
attention_mask=inputs["attention_mask"],
output_hidden_states=True, # Request hidden states
)

But doing this I'm getting this error:

ValueError: If no decoder_input_ids or decoder_inputs_embeds are passed, input_ids cannot be None. Please pass either input_ids or decoder_input_ids or decoder_inputs_embeds.

Also I am using this model for inference only, what does the decoder_input_ids mean and where I can find this to pass in the forward method.

Sign up or log in to comment