Transformers-Tutorials  by NielsRogge

Transformer demos using Hugging Face, implemented in PyTorch

Created 5 years ago
11,225 stars

Top 4.5% 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

2 months ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
3
Star History
61 stars in the last 30 days

Explore Similar Projects

Starred by Jiayi Pan Jiayi Pan(Author of SWE-Gym; MTS at xAI), Shizhe Diao Shizhe Diao(Author of LMFlow; Research Scientist at NVIDIA), and
1 more.

METER by zdou0830

0%
373
Multimodal framework for vision-and-language transformer research
Created 3 years ago
Updated 2 years ago
Starred by Aravind Srinivas Aravind Srinivas(Cofounder of Perplexity), Stas Bekman Stas Bekman(Author of "Machine Learning Engineering Open Book"; Research Engineer at Snowflake), and
4 more.

Awesome-pytorch-list by bharathgs

0.1%
16k
Curated list of PyTorch content on GitHub
Created 8 years ago
Updated 1 year ago
Feedback? Help us improve.