Skip to main content

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

Tests GitHub PyPI

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

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}
}

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

adapter-transformers-2.1.1.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

adapter_transformers-2.1.1-py3-none-any.whl (2.5 MB view details)

Uploaded Python 3

File details

Details for the file adapter-transformers-2.1.1.tar.gz.

File metadata

  • Download URL: adapter-transformers-2.1.1.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.23.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.46.0 CPython/3.6.8

File hashes

Hashes for adapter-transformers-2.1.1.tar.gz
Algorithm Hash digest
SHA256 b58915a706feef7b7a23ef66b67a3c84933fc726372dde600b25329cd056d36d
MD5 2a71222ff4e7e1eb6a66ff4c13af3a19
BLAKE2b-256 b8b9c919e947de01f4a696af47a8399969794d775dfe5b44dd00343794f6c142

See more details on using hashes here.

File details

Details for the file adapter_transformers-2.1.1-py3-none-any.whl.

File metadata

  • Download URL: adapter_transformers-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.23.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.46.0 CPython/3.6.8

File hashes

Hashes for adapter_transformers-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 55ca6592d5b90f51c62fd1f93c55ec893e976b7a3e90155529a2a675d670c686
MD5 741fb2e9d556bad12af83636bb9b5d68
BLAKE2b-256 04a536273978a511554205e4502193cfe38b3136039f1ffad1f259508843f658

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page