lightning-transformers  by Lightning-Universe

Archived library for training Transformers with PyTorch Lightning

created 4 years ago
609 stars

Top 54.6% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides flexible components for integrating Hugging Face Transformers with PyTorch Lightning, targeting researchers and engineers who want to leverage PyTorch Lightning's scaling capabilities for Transformer models. It simplifies the setup and training of various NLP tasks by offering pre-built LightningModule and LightningDataModule abstractions.

How It Works

The library abstracts common NLP tasks (like text classification and translation) into reusable LightningModule classes. These modules encapsulate the Hugging Face model and tokenizer, along with task-specific logic. LightningDataModule classes handle dataset loading, preprocessing, and batching, ensuring compatibility with the PyTorch Lightning Trainer. This approach reduces boilerplate code and allows users to focus on model experimentation and scaling.

Quick Start & Requirements

  • Install via pip: pip install lightning-transformers
  • Requires PyTorch Lightning and Hugging Face Transformers.
  • Supports large models (e.g., 6B parameters) with DeepSpeed integration for distributed training and accelerate for efficient inference.
  • Documentation: https://lightning-transformers.readthedocs.io/en/latest/

Highlighted Details

  • Simplifies training of Hugging Face Transformers with PyTorch Lightning.
  • Offers pre-built modules for common NLP tasks and datasets.
  • Supports large model inference and training using accelerate and DeepSpeed.
  • Provides examples for text classification, translation, and language modeling.

Maintenance & Community

  • The repository has been archived as of November 21, 2022.
  • The maintainers suggest that direct integration with PyTorch Lightning's Trainer is now sufficient.
  • Community support is available via Slack.

Licensing & Compatibility

  • The repository does not explicitly state a license in the README. However, the parent organization's typical licensing is Apache 2.0.
  • Compatibility for commercial use is likely, assuming an Apache 2.0 license.

Limitations & Caveats

This repository is archived and no longer actively maintained. The developers recommend using PyTorch Lightning's native integration with Hugging Face Transformers, as the abstractions provided by this library are no longer deemed necessary or are not being supported.

Health Check
Last commit

2 years ago

Responsiveness

1 week

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

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Wei-Lin Chiang Wei-Lin Chiang(Cofounder of LMArena), and
3 more.

sparseml by neuralmagic

0%
2k
Sparsification toolkit for optimized neural networks
created 4 years ago
updated 2 months ago
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.