Skip to content

Instantly share code, notes, and snippets.

@danielpatrickhug
Created March 29, 2021 23:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielpatrickhug/ea11016a61ca2245ff49bba6519f9422 to your computer and use it in GitHub Desktop.
Save danielpatrickhug/ea11016a61ca2245ff49bba6519f9422 to your computer and use it in GitHub Desktop.

How to start contributing to HuggingFace

In this blog post I will show you how to begin contributing to the huggingface transformers library.

Important Links:

  • Website: Link
  • Github Repository: Link
  • Contributing file: Link
  • transformers issues: Link

Getting Started

The first and best place to start understanding how to contribute to huggingface is in the transformers github repository Contributing.md file. The contributing file will give you a run down on everything you need to know to get started by setting up your enviroment and the actual logistics of how to preform a pull request. You will also find the link to the code of conduct file, I recommend that you review that as well. There are several ways you can contribute all of which are equally valued and appreciated.

  • Fixing outstanding issues with the existing code;
  • Implementing new models;
  • Contributing to the examples or to the documentation;
  • Submitting issues related to bugs or desired features;
  • Writing blog posts;

I wont repeat what's in the contributing file because it's already well written, and it's subject to change. So, I'll share a couple other tips that I would have found useful when I started.

Set up a virtual enviroment before installing the requirements.

A good way to keep your computer clean and simplify the process of creating you r enviroment is to use a virtual enviroment to contain all of the dependencies required for the transformers repository. There are two ways of accomplishing this:

  1. venv — Creation of virtual environments
  2. conda enviroments

Or dont use any, it's your life.

Make sure your bash profile contains a python alias for python3

This is a problem I ran into during my first pull request. The reason for this is due to the make file. When running the test, style or fixup commands the make file uses the 'python' command instead of 'python3'. This can lead to your computer thinking you want to use python 2.7 instead of the python 3 if you have 2.7 installed. While this may not effect everyone, it certainly cause me headaches when I first started, so it's something to look for.

Finding beginner level issues

Finding beginner level issues is very simple if you know the right place to look. First, go to the issues tab in the github repository. Next, click on the Label filter and select "Good First Issue" or "Good Second Issue". After you apply the filter you will find several beginner freindly issues to work on. If you're confused about the specifics, you can post on the issues page and ask for clarification. If you're nervous to ask a question, look in the closed issues and closed pull requests to see how past users have succeeded. Remember to be curtious and patient, the maintainers may be busy.

Another way to find how to contribute is to either read the code and look for bugs to report or read the documentation and find grammar errors or explanations that need further clarification. If you find a bug in the code or docs make sure to first post in issues to bring awarness to the issue and notify the maintainers.

The Maintainers

The more time you spend on the repository the more you will start to recognize the same people. There are several maintainers of the repository to look out for as they will be the ones that will review and merge your code. You can find the top contributers on the contributers page. However, the top five are tomwolf, LysandreJik, sgugger, patrickvonplaten and julien-c. Treat them with respect and they will return the favor.

Conculsion

I hope this helps simplify the process for any would be open source contributers. Contributing to open source is great way to get involved with the community, get noticed by companies and get experience working in a production ready enviroment. Huggingface is one of the best communities around in the artificial intelligence field, and by contributing you're strengthening the community. Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment