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

add BartModelWithDecoderPositionIds base model #26

Merged
merged 10 commits into from
Jan 8, 2024

Conversation

ArneBinder
Copy link
Owner

@ArneBinder ArneBinder commented Jan 5, 2024

This PR adds a variant of the PyTorch BART model with a slight modification where the decoder accepts predefined position ids. If not provided, the original logic is used to create the position ids.

The model is based on the BartModel from Transformers 4.35.0, i.e. https://github.com/huggingface/transformers/blob/v4.35.0/src/transformers/models/bart/modeling_bart.py.

Note: This also contains some minor modifications to make the code mypy (v1.4.1) compliant.

EDIT: See #27.

@ArneBinder ArneBinder added the enhancement New feature or request label Jan 5, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jan 5, 2024

Codecov Report

Attention: 18 lines in your changes are missing coverage. Please review.

Comparison is base (38389af) 96.00% compared to head (686dff3) 95.52%.

Files Patch % Lines
...dels/base_models/bart_with_decoder_position_ids.py 88.23% 18 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #26      +/-   ##
==========================================
- Coverage   96.00%   95.52%   -0.49%     
==========================================
  Files          32       33       +1     
  Lines        2303     2456     +153     
==========================================
+ Hits         2211     2346     +135     
- Misses         92      110      +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ArneBinder ArneBinder merged commit 7629dc0 into main Jan 8, 2024
2 checks passed
@ArneBinder ArneBinder deleted the bart_with_decoder_position_ids branch January 8, 2024 11:58
@ArneBinder ArneBinder mentioned this pull request Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants