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

Merge easy_add_model feature branch #1309

Merged
merged 20 commits into from
May 4, 2021
Merged

Conversation

jeswan
Copy link
Collaborator

@jeswan jeswan commented Apr 23, 2021

This PR merges a major refactor feature branch making it easy for users to add a Hugging Face Transformers model. This PR adds documentation for adding a model in guides/models/adding_models.md.

This PR closes #1310, #1236, #1306, and #1191

* use default return_dict in taskmodels and remove hidden state context manager in models.

* return hidden states in output of model wrapper

* update to transformers 4.3.3

* black
…ments (#1268)

* Use jiant transformers model wrapper instead of if-else. Use taskmodel and head factory instead of if-else.

* switch to ModelArchitectures enum instead of strings
)

* refactor getting output from encoder to be member function of jiant model

* switch to explicit encode() in jiant transformers model

* fix simple runscript test

* update to tokenizer 0.10.1
* add flat_strip test

* add list to test cases flat_strip
* moves remaining if-else statments to jiant model or replaces with model agnostic method

* switch from jiant_transformers_model to encoder

* fix bug in flat_strip()
* move model specific tokenization logic to JiantTransformerModels

* implement abstract methods for JiantTransformerModels
* Add DeBERTa with sanity test

* fix tasks circular import

* [WIP] add deberta tests

* Revert "fix tasks circular import"

This reverts commit f924640.

* deberta tests passing with transformers 6472d8

* switch to deberta-v2

* black

* flake8

* fix get_mlm_weights_dict() for deberta-v2

* update to transformers 4.5.0

* mark deberta test_export as slow

* Update test_tokenization_normalization.py

* add guide to add a model
@codecov
Copy link

codecov bot commented Apr 23, 2021

Codecov Report

Merging #1309 (d0efb1c) into master (4d0f6a9) will increase coverage by 1.30%.
The diff coverage is 58.39%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1309      +/-   ##
==========================================
+ Coverage   48.46%   49.77%   +1.30%     
==========================================
  Files         163      162       -1     
  Lines       11220    11210      -10     
==========================================
+ Hits         5438     5580     +142     
+ Misses       5782     5630     -152     
Impacted Files Coverage Δ
jiant/proj/simple/runscript.py 44.53% <ø> (ø)
jiant/tasks/lib/ccg.py 57.14% <0.00%> (ø)
jiant/tasks/lib/ropes.py 20.39% <0.00%> (ø)
jiant/proj/main/modeling/model_setup.py 23.01% <17.24%> (+6.26%) ⬆️
jiant/tasks/lib/templates/squad_style/core.py 30.20% <20.00%> (-0.51%) ⬇️
jiant/tasks/evaluate/core.py 33.33% <41.37%> (+0.43%) ⬆️
jiant/tasks/lib/rte.py 78.12% <50.00%> (-0.91%) ⬇️
jiant/utils/python/datastructures.py 72.41% <50.00%> (-2.79%) ⬇️
jiant/proj/main/modeling/taskmodels.py 33.68% <50.54%> (+8.56%) ⬆️
jiant/proj/main/modeling/primary.py 52.25% <56.92%> (+23.21%) ⬆️
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4d0f6a9...d0efb1c. Read the comment docs.

@jeswan jeswan marked this pull request as ready for review April 26, 2021 16:23
@jeswan jeswan requested a review from zphang as a code owner April 26, 2021 16:23
jiant/proj/main/modeling/heads.py Show resolved Hide resolved
@jeswan jeswan merged commit de5437a into master May 4, 2021
@jeswan jeswan deleted the js/feature/easy_add_model branch May 4, 2021 17:19
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.

Google Colab Error
2 participants