T5 - model.generate() issue
I have finetuned a T5-model on custom dataset, soif I domodel(input_ids=inputs.input_ids, attention_mask=inputs.attention_mask,             decoder_input_ids=batch[“decoder_input_ids”],labels=batch[“labels”],decoder_attention_mask=batch[“decoder_attention_mask”]).lossI’m getting around 0.003 loss, so I assume that’s an indication model has been trained well.But if I use model.generate()-> I’m getting a random or trash as output, I was wondering where i’m going wrong?Please can anyone help me with this
2022-03-14T10:05:09Z
It’s resolved now,I specifically added decoded input ids in the argument, I assumed it will be right shifted while training but that’s not the case.In order to right shift the target sequence, only labels should be provided in the argument
2024-03-18T12:26:48Z
Hi, I’m having the same issue.I assume the solution here was to:either remove thedecoder_input_idsfrom the model forward callmodel(input_ids=batch['input_ids'], attention_mask=batch['attention_mask'], labels=batch['labels'])or manuallyshift_rightthedecoder_input_ids.Do we also have toshift_rightthedecoder_attention_maskas well in this case if we were to passdecoder_input_idsanddecoder_attention_maskto model?