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

Default setting of GenerationConfig #33427

Closed
4 tasks
jiangwangyi opened this issue Sep 11, 2024 · 1 comment
Closed
4 tasks

Default setting of GenerationConfig #33427

jiangwangyi opened this issue Sep 11, 2024 · 1 comment

Comments

@jiangwangyi
Copy link
Contributor

System Info

- `transformers` version: 4.44.2
- Platform: Linux-5.15.0-91-generic-x86_64-with-glibc2.35
- Python version: 3.11.9

Who can help?

@gante @SunMarc

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

When creating a GenerationConfig instance with the following code:

>>> from transformers import GenerationConfig
>>> GenerationConfig(do_sample=False, temperature=0.0)

I encounter the following warning:

UserWarning: `do_sample` is set to `False`. However, `temperature` is set to `0.0` -- this flag is only used in sample-based generation modes. You should set `do_sample=True` or unset `temperature`. This was detected when initializing the generation config instance, which means the corresponding file may hold incorrect parameterization and should be fixed.

I don't believe these two parameters conflict with each other. Additionally, I am curious why the default temperature value is set to 1.0 when do_sample is False by default, indicating that greedy sampling is the default setting.

Expected behavior

  1. No warning should be issued when do_sample=False and temperature=0.0.
  2. Clarification on why the default temperature is 1.0 when do_sample=False.
Copy link

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
Projects
None yet
Development

No branches or pull requests

2 participants