Open dengchengxifrank opened 2 weeks ago
cc @gante for serialization of decode input ids
HI @dengchengxifrank 👋 Thank you for opening this issue 🤗
As shown in our documentation, decoder_start_token_id
and forced_decoder_ids
are not expected to be torch.Tensor
, but rather an int
or a list
of int
.
Changing the type should fix your issues 🤗
@gante Thanks!
System Info
transformers
version: 4.37.2Who can help?
@sanchit-gandhi
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
Expected behavior
I get the errors as:TypeError: Object of type Tensor is not JSON serializable
I wonder how to set the decoder_start_token_id or forced_decoder_ids during training. And I want the training loss is not including the tokens: . Could you please give me some code examples to show how to set the decoder_start_token_id or forced_decoder_ids ?Thanks