A friendly fork of HuggingFace's Transformers, adding Adapters to PyTorch language models
Project description
adapter-transformers
A friendly fork of HuggingFace's Transformers, adding Adapters to PyTorch language models
adapter-transformers
is an extension of HuggingFace's Transformers library, integrating adapters into state-of-the-art language models by incorporating AdapterHub, a central repository for pre-trained adapter modules.
💡 Important: This library can be used as a drop-in replacement for HuggingFace Transformers and regularly synchronizes new upstream changes. Thus, most files in this repository are direct copies from the HuggingFace Transformers source, modified only with changes required for the adapter implementations.
Installation
adapter-transformers
currently supports Python 3.6+ and PyTorch 1.3.1+.
After installing PyTorch, you can install adapter-transformers
from PyPI ...
pip install -U adapter-transformers
... or from source by cloning the repository:
git clone https://github.com/adapter-hub/adapter-transformers.git
cd adapter-transformers
pip install .
Getting Started
HuggingFace's great documentation on getting started with Transformers can be found here. adapter-transformers
is fully compatible with Transformers.
To get started with adapters, refer to these locations:
- Colab notebook tutorials, a series notebooks providing an introduction to all the main concepts of (adapter-)transformers and AdapterHub
- https://docs.adapterhub.ml, our documentation on training and using adapters with adapter-transformers
- https://adapterhub.ml to explore available pre-trained adapter modules and share your own adapters
- Examples folder of this repository containing HuggingFace's example training scripts, many adapted for training adapters
Implemented Methods
Currently, adapter-transformers integrates all architectures and methods listed below:
Method | Paper(s) | Quick Links |
---|---|---|
Bottleneck adapters | Houlsby et al. (2019) Bapna and Firat (2019) |
Quickstart, Notebook |
AdapterFusion | Pfeiffer et al. (2021) | Docs: Training, Notebook |
MAD-X, Invertible adapters |
Pfeiffer et al. (2020) | Notebook |
AdapterDrop | Rücklé et al. (2021) | Notebook |
MAD-X 2.0, Embedding training |
Pfeiffer et al. (2021) | Docs: Embeddings, Notebook |
Prefix Tuning | Li and Liang (2021) | Docs |
Parallel adapters, Mix-and-Match adapters |
He et al. (2021) | Docs |
Compacter | Mahabadi et al. (2021) | Docs |
Supported Models
We currently support the PyTorch versions of all models listed on the Model Overview page in our documentation.
Citation
If you use this library for your work, please consider citing our paper AdapterHub: A Framework for Adapting Transformers:
@inproceedings{pfeiffer2020AdapterHub,
title={AdapterHub: A Framework for Adapting Transformers},
author={Pfeiffer, Jonas and
R{\"u}ckl{\'e}, Andreas and
Poth, Clifton and
Kamath, Aishwarya and
Vuli{\'c}, Ivan and
Ruder, Sebastian and
Cho, Kyunghyun and
Gurevych, Iryna},
booktitle={Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations},
pages={46--54},
year={2020}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cody-adapter-transformers-3.0.1.tar.gz
.
File metadata
- Download URL: cody-adapter-transformers-3.0.1.tar.gz
- Upload date:
- Size: 3.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 272fddb6f51e9e1592a58a1ff8d1eaf8d252a28c41665d4ea7246f0449f4ac50 |
|
MD5 | 65e2cd4deaa3898ad17c805e406dd745 |
|
BLAKE2b-256 | cfeeedbd101049c8255189e0a5678e003c02ca18ab29b138cf74d79e6089ea25 |
File details
Details for the file cody_adapter_transformers-3.0.1-py3-none-any.whl
.
File metadata
- Download URL: cody_adapter_transformers-3.0.1-py3-none-any.whl
- Upload date:
- Size: 3.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b558cd3af3aa2e444941a9d15e2ccd4f86b974d5f7b59261e858eda7a20d07bb |
|
MD5 | 1a8c9aeaa48dca724e0ec7b0d1df8717 |
|
BLAKE2b-256 | bb9f269e74fe5d20a4c4e06f01ad29946e33978c16d34f3afc03281b340ae974 |