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

remove redundant logging from longformer #30365

Conversation

riklopfer
Copy link
Contributor

What does this PR do?

Longformer warning_once call contains pretty unique information. This PR removes some of that info so that the message should actually only be logged once.

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@ArthurZucker and @younesbelkada

Copy link
Contributor

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

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

Hi @riklopfer
Thanks for the proposed fix !
seq_len + padding_le & seq_len & attention_window should always be different no? Can you elaborate more on the redundancy of the warning message ? 🙏

@riklopfer
Copy link
Contributor Author

@younesbelkada this isn't really a bug. Just excessive logging IMO. The warning_once call caches the messages so only unique messages will be logged. This means that, 1 is padded to 512, 2 is padded to 512, 3 is padded to 512, etc, etc. This change should only log once since it doesn't include the info about the before and after sequence length.

Copy link
Contributor

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

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

Makes sense thanks for explaining! Thanks for taking care of the redundant logging in longformer !

@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!

@amyeroberts amyeroberts merged commit 179ab09 into huggingface:main Apr 23, 2024
18 checks passed
itazap pushed a commit that referenced this pull request May 14, 2024
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.

4 participants