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

BART-base save_pretrained triggers a warning about GenerationConfig #28793

Closed
3 of 4 tasks
Kripner opened this issue Jan 31, 2024 · 2 comments
Closed
3 of 4 tasks

BART-base save_pretrained triggers a warning about GenerationConfig #28793

Kripner opened this issue Jan 31, 2024 · 2 comments

Comments

@Kripner
Copy link
Contributor

Kripner commented Jan 31, 2024

System Info

  • transformers version: 4.37.0
  • Platform: Linux-6.5.0-15-generic-x86_64-with-glibc2.31
  • Python version: 3.10.13
  • Huggingface_hub version: 0.20.3
  • Safetensors version: 0.4.1
  • Accelerate version: 0.26.1
  • Accelerate config: not found
  • PyTorch version (GPU?): 2.1.2 (True)
  • Tensorflow version (GPU?): not installed (NA)
  • Flax version (CPU?/GPU?/TPU?): not installed (NA)
  • Jax version: not installed
  • JaxLib version: not installed
  • Using GPU in script?: Yes
  • Using distributed or parallel set-up in script?: No

Who can help?

@ArthurZucker @younesbelkada

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

from transformers import AutoModelForSeq2SeqLM

model = AutoModelForSeq2SeqLM.from_pretrained("facebook/bart-base")
model.save_pretrained("model")

Expected behavior

Expected behavior: The model is saved without warnings.

Actual behavior: Following warning is triggered before saving the model:

Some non-default generation parameters are set in the model config. These should go into a GenerationConfig file (https://huggingface.co/docs/transformers/generation_strategies#save-a-custom-decoding-strategy-with-your-model) instead. This warning will be raised to an exception in v4.41.
Non-default generation parameters: {'early_stopping': True, 'num_beams': 4, 'no_repeat_ngram_size': 3, 'forced_bos_token_id': 0, 'forced_eos_token_id': 2}

@ArthurZucker
Copy link
Collaborator

Hey that is expected as it is a pretty old model! You can safely ignore this for now, otherwise they should be removed. Feel free to open an issue on the repository's discussion tab !

Copy link

github-actions bot commented Mar 2, 2024

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants