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 πŸ’Ύ.

The Hub currently hosts three different repo types:

  • models
  • datasets
  • Spaces, which are ML demo apps

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, for instance for models:

  • Model 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 model repos have a widget that allows anyone to do inference directly in 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!

How can I rename or transfer a repo?

You can go to the settings page in any repo to achieve this. Note that there are certain limitations in terms of use cases.

Moving can be used in these use cases βœ…

  • Renaming a repository within same user.
  • Renaming a repository within same organization. The user must be part of the organization and have "write" or "admin" rights in the organization.
  • Transferring repository from user to an organization. The user must be part of the organization and have "write" or "admin" rights in the organization.
  • Transferring a repository from an organization to yourself. You must be part of the organization, and have "admin" rights in the organization.
  • Transferring a repository from a source organization to another target organization. The user must have "admin" rights in the source organization and either "write" or "admin" rights in the target organization.

Moving does not work for ❌

  • Transferring a repository from an organization to another user who is not yourself.
  • Transferring a repository from a source organization to another target organization if the user does not have both "admin" rights in the source organization and either "write" or "admin" rights in the target organization.
  • Transferring a repository from user A to user B.

If these are use cases you need help with, please send us an email at website at huggingface.co.

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

πŸ€—