Did you ever want to contribute to transformers but not know how? We need help from the community with two big problems:
Firstly , we want to convert our TensorFlow code to use a new decorator to handle input preprocessing. This greatly simplifies and cleans up every TF model in our entire codebase. We estimate that over 10,000 lines of code could be removed by this change, and 10,000 more made simpler and more readable, without any loss in functionality. This will make the code much more maintainable and approachable for newcomers, which will lead to fewer bugs and more new features in future.
Secondly , we want to add type hints to both PyTorch and TensorFlow models. Type hints are currently used inconsistently across our codebase, and lots of models are missing them. Adding type hints will have several major benefits: It鈥檒l make it easier to catch bugs in the code, it will make it easier to compile PyTorch models with torch.jit.script, and it will enable new features we鈥檙e developing which will make it easier to train Keras models too!
Neither of these changes are difficult, but there are a lot of models in transformers, and that means a lot of code needs to be edited to bring these changes in across the whole codebase - the core team can鈥檛 do it alone, and we need your help! Even if you鈥檝e never contributed to transformers before, this is a great place to start, and even a PR for a single model will really help us out.
If you want to contribute, what should you do?
- Firstly, read our contributing guidelines here: transformers/CONTRIBUTING.md at master 路 huggingface/transformers 路 GitHub
- If you鈥檙e interested in adding the new TensorFlow decorator, please see the instructions here: TF: clearer model variable naming 路 Issue #16051 路 huggingface/transformers 路 GitHub
- If you鈥檙e interested in adding type hints to either TensorFlow or PyTorch models, please see the instructions here: Add missing type hints 路 Issue #16059 路 huggingface/transformers 路 GitHub
It鈥檚 totally okay to do both at once, of course! If you want to do that, please make sure that the model you want to update hasn鈥檛 been claimed in either issue, then reply in both claiming it, and file a single PR containing both the decorator and type hint updates.
If you鈥檇 like to help, but this is all a bit overwhelming, don鈥檛 worry! You can join the community Discord if you want to talk with other contributors. Feel free to ask questions in there and help each other out, and we鈥檒l try to have people from the core team drop in to provide assistance too!
This cleanup sprint will be running for the next weeks , from now until March 20th.