/torch-adapters

Small Library of PyTorch Adaptation modules

Primary LanguagePythonMIT LicenseMIT

Torch Adapters

Introduction

Small Library of Torch Adaptation modules

Supported Methods

  • LoRA
  • Prompt Tuning
  • Bottleneck Adapter
  • Prefix Tuning
  • IA3 (single task)
  • P-Tuning

Installation

You can install torch-adapters using:

$ pip install torch-adapters

Usage

from torch_adapters.utils import add_lora

# Add lora to the model
add_lora(model, ["key", "value"], {"alpha": 8, "r": 8})