EricFillion / happy-transformer

Happy Transformer makes it easy to fine-tune and perform inference with NLP Transformer models.
http://happytransformer.com
Apache License 2.0
517 stars 66 forks source link

Add ability to use models from private repositories #266

Closed davidcoallier closed 3 years ago

davidcoallier commented 3 years ago

Introduction 🤞

Big fan of HappyTransformer, but I've noticed that we're lacking the ability to use private repositories. This pull-request implements the use_auth_token which we use in our fork.

I was considering simply adding a reference to **kwargs and pass that to the from_pretrained(...) calls but decided against it.

Documentation 📘

Every model's documentation has been updated to reflect the new API capability.

Backwards Compatibility 👀

The does not break API backwards compatibility 🙏

Further Discussions 💬

One thing I've noticed missing from HF is using an environment variable to pass the auth token instead of having it explicitly defined as part of the model calls.

This is something I'd like to explore and figure out if it's any interest to you. If so I'll take a stab. 🤷‍♂️

EricFillion commented 3 years ago

Version 2.3.2 is live and contains these changes! Thanks for your help.

davidcoallier commented 3 years ago

Great thanks!

davidcoallier commented 3 years ago

Just noticed something isn't working right. Must have missed something when porting-back. Investigating now. Might be worth reverting unless I find a fix this morning on the train.

davidcoallier commented 3 years ago

Ok I found the problem, will issue a new PR to address it. Somehow forgot to include the init use_auth_token when porting the code over.