Full access is free during Beta. A paid subscription will be offered after Beta.

Hugging Face — User Guide

Models and datasets hub—the open-source AI community home.

Visit website
Freemium
Strengths
  • 500,000+ open source models, covering all AI fields such as NLP, CV, audio, etc.
  • The Transformers library is an industry-standard tool for deep learning
  • The Spaces platform allows you to deploy and experience AI applications for free
  • Data set warehouse to facilitate model training and evaluation
  • Active developer community, detailed model documentation
Best for
  • Find and download pre-trained models (BERT, LLaMA, Stable Diffusion, etc.)
  • Use the Transformers library for model inference and fine-tuning
  • Experience various AI demos on Spaces
  • Upload and share your own trained models
  • Find high-quality training data sets

Find and use pretrained models

Hugging Face's model warehouse is the world's largest AI model library. Learning to search and use models is the first step.

Scenario

Find the right model for your task

Prompt example
(On the Hugging Face model search page)

Search strategy:
1. Enter the task type in the search box, such as "text-classification"
2. Use filters: Sort by language (Chinese), task type, download volume
3. View the Model Card to learn how to use it
4. See "Files and versions" for model sizes
Output / what to expect

Find a suitable Chinese text classification model, such as hfl/chinese-roberta-wwm-ext, Model cards contain:

  • Model introduction and applicable scenarios
  • Use code examples
  • Performance evaluation results
  • License information
Tips

Give priority to models with high download volume and detailed Model Cards, so the quality is more guaranteed.

Scenario

Use the Transformers library to quickly call models

Prompt example
Please show how to use the Hugging Face Transformers library for Chinese sentiment analysis:

Requirements:
- Use pipeline API (easiest way)
- Choose a sentiment analysis model suitable for Chinese
- Process a batch of text and output the results
- Code can be run directly
Output / what to expect
from transformers import pipeline

#Load Chinese sentiment analysis model
classifier = pipeline(
    "text-classification",
    model="lxyuan/distilbert-base-multilingual-cased-sentiments-student"
)

texts = [
    "This product is really easy to use, highly recommended!",
    "The quality is very poor and not worth the price.",
    "It's okay, so-so."
]

results = classifier(texts)
for text, result in zip(texts, results):
    print(f"Text: {text}")
    print(f"Sentiment: {result['label']}, Confidence: {result['score']:.3f}\n")

Output the sentiment label (positive/negative) and confidence of each text.

Tips

The pipeline API is the simplest way to use it and is suitable for rapid prototyping. In the production environment, it is recommended to load the model directly.

Starter & above

The rest of this guide

Additional scenarios and the full comparison table are included with Starter and above. Sign in with an eligible account to load them.

You're on the Free plan. Upgrade to Starter or higher to unlock the rest of this guide—additional scenarios and the full comparison table.

Loading full guide…