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

ENH: Do not pass warning message in case quantization_config is in config but not passed as an arg #28988

Merged
merged 4 commits into from
Feb 14, 2024

Conversation

younesbelkada
Copy link
Contributor

@younesbelkada younesbelkada commented Feb 13, 2024

What does this PR do?

Currently, transformers always warns users with a wrong message when loading a model that has a quantization_config without even passing quantization_config to from_pretrained. Indeed we should warn users only when quantization_config_from_args instead of all the time

cc @amyeroberts

/usr/local/lib/python3.10/dist-packages/transformers/quantizers/auto.py:151: UserWarning: You passed `quantization_config` or equivalent parameters to `from_pretrained` but the model you're loading already has a `quantization_config` attribute. The `quantization_config` from the model will be prevail.
  warnings.warn(warning_msg)

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Collaborator

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing!

Just some small nits

src/transformers/quantizers/auto.py Outdated Show resolved Hide resolved
src/transformers/quantizers/auto.py Show resolved Hide resolved
younesbelkada and others added 2 commits February 14, 2024 01:05
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
@younesbelkada younesbelkada merged commit 1d12b8b into main Feb 14, 2024
20 of 21 checks passed
@younesbelkada younesbelkada deleted the younesbelkada-patch-1 branch February 14, 2024 00:19
sbucaille pushed a commit to sbucaille/transformers that referenced this pull request Feb 14, 2024
…config but not passed as an arg (huggingface#28988)

* Update auto.py

* Update auto.py

* Update src/transformers/quantizers/auto.py

Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>

* Update src/transformers/quantizers/auto.py

Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>

---------

Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
itazap pushed a commit that referenced this pull request May 14, 2024
…config but not passed as an arg (#28988)

* Update auto.py

* Update auto.py

* Update src/transformers/quantizers/auto.py

Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>

* Update src/transformers/quantizers/auto.py

Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>

---------

Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

3 participants