transformers  by huggingface

ML library for pretrained model inference and training

created 6 years ago
147,686 stars

Top 0.0% on sourcepulse

GitHubView on GitHub
Project Summary

🤗 Transformers provides state-of-the-art pretrained models for natural language understanding, generation, computer vision, audio, video, and multimodal tasks. It targets researchers, engineers, and developers, offering a unified API to fine-tune models, build inference applications, and leverage generative AI across various modalities, with over 500K+ models available on the Hugging Face Hub.

How It Works

The library offers a unified API for a vast array of pretrained models, abstracting away complex preprocessing and model loading. Its core strength lies in its accessibility and flexibility, allowing users to easily switch between PyTorch, TensorFlow, and JAX frameworks for training, evaluation, and production. The design prioritizes rapid iteration for researchers by exposing model internals with minimal abstraction, while the high-level pipeline API simplifies inference for developers.

Quick Start & Requirements

  • Installation: pip install transformers or uv pip install transformers. For development: git clone https://github.com/huggingface/transformers.git && cd transformers && pip install .
  • Prerequisites: Python 3.9+, PyTorch 2.1+, TensorFlow 2.6+, or Flax 0.4.1+.
  • Resources: Specific model requirements (GPU, VRAM) vary.
  • Links: Quickstart, Documentation, Demo

Highlighted Details

  • Supports over 500K+ pretrained model checkpoints across multiple modalities.
  • Unified API for PyTorch, TensorFlow, and JAX.
  • High-level pipeline API for simplified inference across tasks.
  • Extensive examples for reproducing research results and custom adaptation.

Maintenance & Community

The project is actively maintained by Hugging Face and a large community. Links to community resources are available via the Hugging Face Hub.

Licensing & Compatibility

The library is typically distributed under the Apache 2.0 license, facilitating commercial use and integration with closed-source projects.

Limitations & Caveats

The library is not intended as a modular toolbox for general neural network building blocks; for generic ML loops, libraries like Accelerate are recommended. Example scripts may require adaptation for specific use cases.

Health Check
Last commit

10 hours ago

Responsiveness

1 day

Pull Requests (30d)
516
Issues (30d)
215
Star History
4,590 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.