This repository has been archived by the owner on Dec 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reinit layers of pretrained transformer in cached_transformers.get() (#…
…5505) * Arg to re-init some layers of pretrained transformer * Better error handelling for bad indices * Add a test for reinit_layers * Type cast to appease mypy * Get number of hidden layers in model agnostic way * Support a list of regexes in reinit_modules * Add tests for when reinit_modules is a list of str * Fix broken test for re-initializing modules * Break reinit_modules unit test into two * Update changelog * Tests for when reinit_modules should have no effect * Revert pretrained transformer embedder to main * Move reinit_modules feature to cached transformers * Better error message for invalid reinit_modules argument Co-authored-by: Pete <epwalsh10@gmail.com> * Correct error message to say tuple, not list * Add note about layer indices failing in docstring * Correct "list" with "tuple" in error message Co-authored-by: Pete <petew@allenai.org> Co-authored-by: Pete <epwalsh10@gmail.com>
- Loading branch information
1 parent
ec1fb69
commit 06ec7f9
Showing
4 changed files
with
184 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters