Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some non-default generation parameters are set in the model config #1351

Closed
1 of 4 tasks
vidyasiv opened this issue Sep 23, 2024 · 6 comments
Closed
1 of 4 tasks

Some non-default generation parameters are set in the model config #1351

vidyasiv opened this issue Sep 23, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@vidyasiv
Copy link
Contributor

System Info

transformers_future branch

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

Test failure: tests.test_examples.MultiCardSeq2SeqSpeechRecognitionExampleTester testMethod=test_run_speech_recognition_seq2seq_whisper-small_multi_card

rank0]: ValueError: Some non-default generation parameters are set in the model config. These should go into either a) `model.generation_config` (as opposed to `model.config`); OR b) a GenerationConfig file (https://huggingface.co/docs/transformers/generation_strategies#save-a-custom-decoding-strategy-with-your-model) 
[rank0]: Non-default generation parameters: {'max_length': 448, 'suppress_tokens': [1, 2, 7, 8, 9, 10, 14, 25, 26, 27, 28, 29, 31, 58, 59, 60, 61, 62, 63, 90, 91, 92, 93, 359, 503, 522, 542, 873, 893, 902, 918, 922, 931, 1350, 1853, 1982, 2460, 2627, 3246, 3253, 3268, 3536, 3846, 3961, 4183, 4667, 6585, 6647, 7273, 9061, 9383, 10428, 10929, 11938, 12033, 12331, 12562, 13793, 14157, 14635, 15265, 15618, 16553, 16604, 18362, 18956, 20075, 21675, 22520, 26130, 26161, 26435, 28279, 29464, 31650, 32302, 32470, 36865, 42863, 47425, 49870, 50254, 50258, 50360, 50361, 50362], 'begin_suppress_tokens': [220, 50257]}

Model: https://huggingface.co/openai/whisper-small

@regisss which way you recommend we solve this?

cc: @splotnikov

Expected behavior

Test passes

@vidyasiv vidyasiv added the bug Something isn't working label Sep 23, 2024
@splotnikv
Copy link

I've looked at config files. There are two config files on the system that hold similar information. These are paths on my system /root/.cache/huggingface/hub/models--openai--whisper-small/snapshots/973afd24965f72e36ca33b3055d56a652f456b4d/config.json and /root/.cache/huggingface/hub/models--openai--whisper-small/snapshots/973afd24965f72e36ca33b3055d56a652f456b4d/generation_config.json. max_length and begin_suppress_tokens values in these files are the same, suppress_tokens are slightly different, generation_config_org.json has two more values in the list - 50358 and 50359. I don't know is it important. I removed all three values from config.json and reran the test. It passed, so one of the possible solutions to this issue is to update config.json.

@vidyasiv
Copy link
Contributor Author

@regisss please take a look

@vidyasiv
Copy link
Contributor Author

vidyasiv commented Oct 1, 2024

@splotnikv , can you verify if this PR resolves the issue? #1384

@vidyasiv
Copy link
Contributor Author

vidyasiv commented Oct 2, 2024

Verified issue is resolved by #1384 , can be closed after merge

@regisss
Copy link
Collaborator

regisss commented Oct 2, 2024

Workaround in #1384, let's close this issue once it is solved in Transformers.

@regisss
Copy link
Collaborator

regisss commented Oct 9, 2024

Issue solved in Transformers v4.45.2, see b06b605.

@regisss regisss closed this as completed Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants