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

Make the attention mask a mandatory argument of models #281

Merged

Conversation

danieldk
Copy link
Contributor

@danieldk danieldk commented Aug 2, 2023

Description

It is very easy to forget to pass the attention mask, giving bad output.
On the other hand it is very unlikely that someone doesn't want to use
an attention mask. In such cases, it is always possible to create a
custom mask all elements set to True.

While at it, also consistently make piece_ids/attention_mask
positional arguments, while making all other arguments kwarg-only.

Types of change

Checklist

  • I confirm that I have the right to submit this contribution under the project's MIT license.
  • I ran the tests, and all new and existing tests passed.
  • My changes don't require a change to the documentation, or if they do, I've added all required information.

It is very easy to forget to pass the attention mask, giving bad output.
On the other hand it is very unlikely that someone doesn't want to use
an attention mask. In such cases, it is always possible to create a
custom mask all elements set to `True`.

While at it, also consistently make `piece_ids`/`attention_mask`
positional arguments, while making all other arguments kwarg-only.
@danieldk danieldk added feat/model Feature: models feat/layers Feature: Layers type/maintenance Type: Maintenance labels Aug 2, 2023
Copy link
Collaborator

@shadeMe shadeMe left a comment

Choose a reason for hiding this comment

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

LGTM!

docs/source/deployment.rst Outdated Show resolved Hide resolved
Co-authored-by: Madeesh Kannan <[email protected]>
@shadeMe shadeMe merged commit 1aaff8f into explosion:main Aug 2, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat/layers Feature: Layers feat/model Feature: models type/maintenance Type: Maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants