Skip to content

Warnings controlled by logger level#26527

Merged
LysandreJik merged 2 commits intomainfrom
logger-level
Oct 12, 2023
Merged

Warnings controlled by logger level#26527
LysandreJik merged 2 commits intomainfrom
logger-level

Conversation

@LysandreJik
Copy link
Member

@LysandreJik LysandreJik commented Oct 2, 2023

This explicitely shows how to control warnings using the logging level setters in `transformers.

Fix #26381

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Oct 2, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

Could you explain a bit more what this involves + guidelines for futur PR's ?


By default, `tqdm` progress bars will be displayed during model download. [`logging.disable_progress_bar`] and [`logging.enable_progress_bar`] can be used to suppress or unsuppress this behavior.

## `logging` vs `warnings`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add an example of what this means for us now?
(calling logger with deprecation warning for example?) for all devs !

Copy link
Member Author

Choose a reason for hiding this comment

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

You don't call logger with deprecation warnings, you just use warnings.warn. But now, you can capture those and eliminate them from the logging system simply.

LysandreJik and others added 2 commits October 11, 2023 17:05
Co-authored-by: Sahil Bhosale <sahilbhosale63@live.com>
Co-authored-by: Adithya4720 <hegdeadithyak@gmail.com>
Co-authored-by: Sachin Singh <sachinishu02@gmail.com>
Co-authored-by: Riya Dhanduke <113622644+riiyaa24@users.noreply.github.com>
Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

Good to go!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove usage of warnings.warn

3 participants