-
Notifications
You must be signed in to change notification settings - Fork 383
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BERT fine-tuning with huggingface transformers (#839)
BERT fine-tuning with huggingface transformers Add a notebook that shows what steps need to be taken to fine-tune a BERT model in skorch with the help of the huggingface transformers library. Huggingface transformers is probably the most popular library that implements BERT and other similar models. Ideally, skorch can work with transformers with as little friction as possible. There are actually surprisingly few steps involved, but some of them may not be obvious to most users, which is why the notebook could be helpful. As a cherry on top, the notebook also shows mixed precision training with huggingface accelerate, which indeed results in a very nice boost of training and prediction speed. Other than that, the notebook is actually quite sparse in explanations, instead referring to the fine-tuning docs of hugginface itself.
- Loading branch information
1 parent
91a5876
commit d7cfdcc
Showing
7 changed files
with
1,016 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
docutils<0.18 | ||
gpytorch>=1.5 | ||
numpy>=1.13.3 | ||
torch>=1.11.0 | ||
transformers | ||
sphinx-rtd-theme==0.4.0 | ||
numpydoc==0.8.0 | ||
scikit-learn>=0.19.1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ skorch | |
dataset | ||
exceptions | ||
helper | ||
hf | ||
history | ||
net | ||
probabilistic | ||
|
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
Oops, something went wrong.