The🤗Transformerslibraryisoftenabletooffernewmodelsthankstocommunitycontributors.Butthiscanbeachallengingprojectandrequiresanin-depthknowledgeofthe🤗Transformerslibraryandthemodeltoimplement.AtHuggingFace,we're trying to empower more of the community to actively add models and we'veputtogetherthisguidetowalkyouthroughtheprocessofaddingaPyTorchmodel(makesureyouhave[PyTorchinstalled](https://pytorch.org/get-started/locally/)).
ofthemodel's original repository. At Hugging Face, we are trying to empower the community more and more to add models
independently. Thus, for some new models that the community wants to be added to 🤗 Transformers, we create a customized
*call-for-model-addition* that explains step-by-step how to add the requested model. With this
*call-for-model-addition*, we want to teach a motivated and experienced contributor of the community how to port a
model to 🤗 Transformers.
If this sounds like something you would be interested in, feel free to check out the currently open
Ifyou're interested in implementing a TensorFlow model, take a look at the [How to convert a 🤗 Transformers model to TensorFlow](add_tensorflow_model) guide!
</Tip>
Along the way, you'll:
If selected, you will then work closely with one member of the Hugging Face team to integrate the model into 🤗
-getinsightsintoopen-sourcebestpractices
Transformers. By doing so, you will both gain a theoretical and deep practical understanding of the proposed model. But
AHuggingFaceteammemberwillbeavailabletohelpyoualongthewaysoyou'll never be alone. 🤗 ❤️
- understand the design principles of one of the most popular NLP libraries
- learn how to do efficiently test large NLP models
- learn how to integrate Python utilities like `black`, `isort`, `make fix-copies` into a library to always
ensure clean and readable code
We are also more than happy if you want to add a model that cannot be found in the “calls-for-model-addition” folder.
To get started, open a [New model addition](https://github.com/huggingface/transformers/issues/new?assignees=&labels=New+model&template=new-model-addition.yml) issue for the model you want to see in 🤗 Transformers. If you'renotespeciallypickyaboutcontributingaspecificmodel,youcanfilterbythe[Newmodellabel](https://github.com/huggingface/transformers/labels/New%20model)toseeifthereareanyunclaimedmodelrequestsandworkonit.
The following sections explain in detail how to add a new model. It might also be very helpful to check out already
added models to see if those resemble the model you would like to add [here](https://github.com/huggingface/transformers/pulls?q=is%3Apr+label%3A%22PR+for+Model+Addition%22+is%3Aclosed).
To start, let'strytogetageneraloverviewoftheTransformerslibrary.
Onceyou've opened a new model request, the first step is to get familiar with 🤗 Transformers if you aren'talready!
##Generaloverviewof🤗Transformers
##Generaloverviewof🤗Transformers
...
@@ -144,20 +138,20 @@ In the following, we try to give you a general recipe that we found most useful
...
@@ -144,20 +138,20 @@ In the following, we try to give you a general recipe that we found most useful
The following list is a summary of everything that has to be done to add a model and can be used by you as a To-Do
The following list is a summary of everything that has to be done to add a model and can be used by you as a To-Do
List:
List:
- 1. ☐ (Optional) Understood theoretical aspects
☐ (Optional) Understood the model'stheoreticalaspects<br>
- 2. ☐ Prepared transformers dev environment
☐Prepared🤗Transformersdevenvironment<br>
- 3. ☐ Set up debugging environment of the original repository