huggingface / optimum-habana

Easy and lightning fast training of 🤗 Transformers on Habana Gaudi processor (HPU)
Apache License 2.0
148 stars 186 forks source link

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

Open vidyasiv opened 1 week ago

vidyasiv commented 1 week ago

System Info

transformers_future branch

Information

Tasks

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

splotnikv commented 5 days ago

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 commented 4 days ago

@regisss please take a look