Hugging Face Hub documentation

What's the Hugging Face Hub?

We are helping the community work together towards the goal of advancing Artificial Intelligence πŸ”₯.

Not one company, even the Tech Titans, will be able to β€œsolve AI” by themselves – the only way we'll achieve this is by sharing knowledge and resources. On the Hugging Face Hub we are building the largest collection of models, datasets and metrics in order to democratize and advance AI for everyone πŸš€. The Hugging Face Hub works as a central place where anyone can share and explore models and datasets.

What's a repository?

The Hugging Face Hub hosts Git-based repositories which are storage spaces that can contain all your files πŸ’Ύ.

These repositories have multiple advantages over other hosting solutions:

  • versioning
  • commit history and diffs
  • branches

On top of that, Hugging Face Hub repositories have many other advantages:

  • Repos provide useful metadata about their tasks, languages, metrics, etc.
  • Anyone can play with the model directly in the browser!
  • Training metrics charts are displayed if the repository contains TensorBoard traces.
  • An API is provided to use the models in production settings.
  • Over 10 frameworks such as πŸ€— Transformers, Asteroid and ESPnet support using models from the Hugging Face Hub.

What's a widget?

Many repos have a widget that allows anyone to do inference directly on the browser!

Here are some examples:

You can try out all the widgets here.

What's the Inference API?

The Inference API allows you to send HTTP requests to models in the Hugging Face Hub. The Inference API is 2x to 10x faster than the widgets! ⚑⚑

How can I explore the Hugging Face Hub?

How is a model's type of inference API and widget determined?

To determine which pipeline and widget to display (text-classification, token-classification, translation, etc.), we analyze information in the repo such as the metadata provided in the model card and configuration files. This information is mapped to a single pipeline_tag. We choose to expose only one widget per model for simplicity.

For most use cases, the model type is determined from the tags. For example, if there is tag: text-classification in the metadata, the inferred pipeline_tag will be text-classification.

For πŸ€— Transformers however, the model type is determined automatically from config.json. The architecture can be used to determine the type: for example, AutoModelForTokenClassification corresponds to token-classification. If you're really interested in this, you can see pseudo-code in this gist.

You can always manually override your pipeline type with pipeline_tag: xxx in your model card metadata.

What are all the possible task/widget types?

You can find all the supported tasks here.

Here are some with links to examples:

How can I load/push from/to the Hub?

You have access to the repos as with any other Git-based repository! You can even upload very large files.

Here is a video to learn more about it from our course!

What's the origin of πŸ€— name?

πŸ€—