[FIXED] Getting error: You have explicitly specified `forced_decoder_ids`

#1
by disazoz - opened

Hi.

I'm trying to run your model with first code snippet from model card but getting error:

ValueError: You have explicitly specified forced_decoder_ids. Please remove the forced_decoder_ids argument in favour of input_ids or decoder_input_ids respectively.

Any ideas how can it be fixed? What the version of python, transformers library do you use?

I know about this whisper error. I fixed this error like this:

model.config.forced_decoder_ids = None
model.config.suppress_tokens = []
model.generation_config.forced_decoder_ids = None
model.generation_config._from_model_config = True

Please let me know if that resolved the issue.

Yes. Now it's working! Thanks a lot.

Am still getting warnings like this. There are also some other warnings, but they don't seem to affect the functionality.

`generation_config` default values have been modified to match model-specific defaults: {'suppress_tokens': [], 'begin_suppress_tokens': [220, 50257]}. If this is not desired, please set these values 
explicitly.
The attention mask is not set and cannot be inferred from input because pad token is same as eos token. As a consequence, you may observe unexpected behavior. Please pass your input's `attention_mask` to obtain reliable results.
A custom logits processor of type <class 'transformers.generation.logits_process.SuppressTokensLogitsProcessor'> has been passed to `.generate()`, but it was also created in `.generate()`, given its parameterization. The custom <class 'transformers.generation.logits_process.SuppressTokensLogitsProcessor'> will take precedence. Please check the docstring of <class 'transformers.generation.logits_process.SuppressTokensLogitsProcessor'> to see related `.generate()` flags.
A custom logits processor of type <class 'transformers.generation.logits_process.SuppressTokensAtBeginLogitsProcessor'> has been passed to `.generate()`, but it was also created in `.generate()`, given its parameterization. The custom <class 'transformers.generation.logits_process.SuppressTokensAtBeginLogitsProcessor'> will take precedence. Please check the docstring of <class 'transformers.generation.logits_process.SuppressTokensAtBeginLogitsProcessor'> to see related `.generate()` flags.

Thanks a lot. At the moment, the best IPA translation on my data from your model.

disazoz changed discussion title from Getting error: You have explicitly specified `forced_decoder_ids` to [FIXED] Getting error: You have explicitly specified `forced_decoder_ids`

Nice to hear that

neurlang changed discussion status to closed
Your need to confirm your account before you can post a new comment.

Sign up or log in to comment