Transformers-Tutorials  by NielsRogge

Transformer demos using Hugging Face, implemented in PyTorch

created 4 years ago
11,128 stars

Top 4.7% on sourcepulse

GitHubView on GitHub
Project Summary

This repository provides PyTorch-based demonstrations for a wide array of Hugging Face Transformers models, covering natural language processing, computer vision, and multimodal tasks. It's designed for researchers and developers looking to understand and implement state-of-the-art transformer architectures.

How It Works

The project showcases individual model implementations through Jupyter notebooks, demonstrating both inference and fine-tuning procedures. It leverages the Hugging Face ecosystem, including Transformers, Tokenizers, and Datasets, to provide practical examples of how to integrate these models into custom workflows. The demos cover a broad spectrum of tasks, from image classification and object detection to text generation and document analysis.

Quick Start & Requirements

  • Install via pip install transformers datasets torch.
  • Requires PyTorch and a compatible Python environment. GPU acceleration is recommended for most demos.
  • Links to Hugging Face's free course and ecosystem overview are provided for foundational knowledge.

Highlighted Details

  • Extensive coverage of numerous transformer architectures including BERT, GPT-J, ViT, DETR, CLIPSeg, LayoutLMv3, TrOCR, and more.
  • Demonstrations span diverse applications: audio classification, image segmentation, object detection, document AI, video analysis, and code generation.
  • Includes examples of fine-tuning with native PyTorch, PyTorch Lightning, and Hugging Face's Trainer and Accelerate libraries.
  • Features practical data preprocessing examples using native PyTorch Dataset and Hugging Face Datasets.

Maintenance & Community

The repository is maintained by Niels Rogge, a significant contributor to the Hugging Face Transformers library, having added key models like TAPAS, ViT, DINO, and DETR. Users are encouraged to open issues for questions or discussions.

Licensing & Compatibility

The repository itself does not specify a license. However, it heavily relies on the Hugging Face Transformers library, which is typically released under the Apache 2.0 license, allowing for commercial use and integration into closed-source projects.

Limitations & Caveats

All demos are implemented in PyTorch; TensorFlow or other framework support is not provided. The repository is a collection of demonstrations and not a unified library, requiring users to adapt code for specific use cases.

Health Check
Last commit

1 month ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
1
Star History
348 stars in the last 90 days

Explore Similar Projects

Starred by Lilian Weng Lilian Weng(Cofounder of Thinking Machines Lab), Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), and
42 more.

transformers by huggingface

0.2%
148k
ML library for pretrained model inference and training
created 6 years ago
updated 14 hours ago
Feedback? Help us improve.