-
Notifications
You must be signed in to change notification settings - Fork 31.1k
[WIP] Lightning glue example #3290
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
Conversation
|
@srush Can you please take a look? |
Codecov Report
@@ Coverage Diff @@
## master #3290 +/- ##
==========================================
+ Coverage 77.81% 77.99% +0.18%
==========================================
Files 98 98
Lines 16666 16666
==========================================
+ Hits 12969 12999 +30
+ Misses 3697 3667 -30
Continue to review full report at Codecov.
|
srush
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done. Pretty impressive how little code needed to change.
While you are doing this, I think you can be a bit more aggressive about moving code up to basetransformer and moving the manual logging to loggers. But otherwise the code looks great.
Not sure the best way to pull in BaseTransformer.py. The easiest is sys.path.append("../")
|
Looks excellent. I will let @LysandreJik merge tomorrow, and confirm multi-gpu / TPU work. Want to try SQuAD next? |
Sure, I'll give it a go. |
* ✨ Alter base pl transformer to use automodels * 🐛 Add batch size env variable to function call * 💄 Apply black code style from Makefile * 🚚 Move lightning base out of ner directory * ✨ Add lightning glue example * 💄 self * move _feature_file to base class * ✨ Move eval logging to custom callback * 💄 Apply black code style * 🐛 Add parent to pythonpath, remove copy command * 🐛 Add missing max_length kwarg
This PR adds an example of using Pytorch Lightning to run the GLUE benchmark. Additionally, I altered the
transformer_base.pyto use auto models and moved it to the example directory so it could be copied in by any script that wishes to use it.Preferably, the base transformer would have subclasses for the different types of tasks, but I just used a dictionary with a key passed on init instead. (i.e. NER uses
AutoModelForTokenClassificationand GLUE usesAutoModelForSequenceClassification).