AI For Life

← All tools

Model hub

Hugging Face

The GitHub of AI: a place to find, test, share and run open models and datasets.

By Hugging Face

Jump to the full step-by-step walkthrough ↓

Quick demo

Illustrated walkthrough. The code is shown, not run. Run it yourself in Google Colab to see the real output.

What it is

Hugging Face is a website and community where people publish AI models, datasets, and small demo apps called Spaces. It also makes popular open-source libraries such as Transformers. If a company releases open weights, they usually appear on Hugging Face first.

Why people use it

How to get started

  1. Create a free account at huggingface.co.
  2. Browse Models and filter by task (text generation, text-to-image, speech, and so on).
  3. Open a model page and read the model card: what it does, license, limits.
  4. Try it in the page widget or a Space. No code needed.
  5. When ready, run it in Google Colab (free GPU time) or call it through an API.

Try this

from transformers import pipeline

classifier = pipeline('sentiment-analysis')
print(classifier('Our new Medicare guide helped so many clients!'))

Your first code: 3 lines to run a sentiment model. Run it in Google Colab so you install nothing.

Why it matters for business

open models let a startup avoid per-use API costs and keep data in-house, at the price of managing infrastructure.

Full walkthrough: find, test and run your first model

1. The idea in business terms

Think of Hugging Face as an app store plus a library for AI. Instead of paying a company every time you use its AI, you can often download a free "open" model and run it yourself. Your job is to choose the right one and check you are allowed to use it.

2. Create your account and look around

  1. Sign up free at huggingface.co and verify your email.
  2. Click Models. On the left are filters for task (what the model does), language and license.
  3. Choose a task, such as Text Classification or Text-to-Image, and sort by Trending or Most downloads.

3. Read a model card like a buyer

Open any model and read its model card (the main text on the page). Check these five things before you use it:

4. Try it with no code

Many pages have a box on the right where you can type text and see the answer. Others link to a Space, a small demo app. Test with 10 examples from your own work, not just the sample.

5. Run it in Google Colab (free)

  1. Go to colab.research.google.com and sign in with a Google account. Click New notebook.
  2. In the first cell, install the library by typing !pip install transformers and press Shift+Enter to run it.
  3. In the next cell, paste the code from the Try this section above and run it.
  4. The first run downloads the model, so it takes a minute. After that you see the result printed under the cell.
  5. Change the sentence in the quotes and run again to test your own text.

If a model is big, choose Runtime, then Change runtime type and select a GPU. The free tier has limits.

6. Compare and decide

Test two or three models on the same 20 examples that you labeled yourself. Count how many each one got right. The cheapest model that is accurate enough usually wins.

7. Publish your own work

Once you build something (see Build Your Own Model), create a model page, upload it, and write a model card using the same five points above. Link it from your resume and GitHub profile.

Common problems

Business use case

Scenario: A startup receives hundreds of customer reviews a week and wants to tag each one as positive, negative or a feature request.

How it works: Find a text-classification model on Hugging Face, test it on 50 real reviews in the browser or in Google Colab, and run it on the full set. Compare the results with a human check on a sample.

Measure success by: Accuracy on a sample you labeled yourself, hours saved, and the cost compared with a paid API.

Watch out for: Check the model's license before commercial use, and do not upload customer data to a public Space.

Quick facts

What to learn next

Follow the free Hugging Face LLM course, then do the 'Build your own model' guide in this repo.

Hugging Face ↗Free Hugging Face courses ↗