Skip to main content

Unified Parameter-Efficient Fine-Tuning of 100+ LLMs

Project description

# PEFT Factory


Parameter-Efficient Fine-Tuning made easy

PEFT-Factory is a fork of LLaMa-Factory ❤️, upgraded with easy to use PEFT interface, support for HuggingFace PEFT methods and datasets for benchmarking PEFT.


Supported methods

PEFT method name Support
LoRA (including variants) ✅ 🦙
OFT ✅ 🦙
Prefix Tuning ✅ 🤗
Prompt Tuning ✅ 🤗
P-Tuning ✅ 🤗
P-Tuning v2 ✅ 🤗
MPT ✅ 🤗
IA3 ✅ 🤗
LNTuning ✅ 🤗
Bottleneck Adapter ✅ 🤖
Parallal Adapter ✅ 🤖
SeqBottleneck Adapter ✅ 🤖
SVFT ✅ ⚙️
BitFit ✅ ⚙️

Usage

This section provides instructions on how to install PEFT-Factory, download necessary data and methods, and run training using both command line and web UI.

Quickstart

For video example please visit the PEFT-Factory Demonstration Video.

# install package
pip install peftfactory

# dowload repo that contains data, PEFT methods and examples
git clone https://github.com/kinit-sk/PEFT-Factory.git && cd PEFT-Factory

# start web UI
pf webui

Alternatively, you can run training from command line:

# install package
pip install peftfactory

# dowload repo that contains data, PEFT methods and examples
git clone https://github.com/kinit-sk/PEFT-Factory.git && cd PEFT-Factory

Create some variables for envsubst

# run training with config file
TIMESTAMP=`date +%s`
OUTPUT_DIR="saves/bitfit/llama-3.2-1b-instruct/train_wsc_${TIMESTAMP}"
DATASET="wsc"
SEED=123
WANDB_PROJECT="peft-factory-train-bitfit"
WANDB_NAME="bitfit_llama-3.2-1b-instruct_train_wsc"

mkdir -p "${OUTPUT_DIR}"

export OUTPUT_DIR DATASET SEED WANDB_PROJECT WANDB_NAME

Use the template

Utility envsubst replaces the occurances of env variables with their values (see the template).

envsubst < examples/peft/bitfit/llama-3.2-1b-instruct/train.yaml > ${OUTPUT_DIR}/train.yaml

Run the factory

peftfactory-cli train ${OUTPUT_DIR}/train.yaml

Installation

There are multiple ways to install PEFT-Factory. You can install develelopment version from source or install the latest release from PyPI.

Using pip

pip install peftfactory

From Source

Clone the repository

git clone git@github.com:kinit-sk/PEFT-Factory.git

Build the wheel package

make build

Install with pip

pip install dist/[name of the built package].whl

Get data and methods

To download data, methods and examples for training please download the repository from GitHub.

git clone https://github.com/kinit-sk/PEFT-Factory.git && cd PEFT-Factory

Run training

You can run training from command line or using web UI.

From Command Line

To run training from command line use the following command:

pf train [path to config file].yaml

Using web UI

To run the web UI use the following command:

pf webui

Project details


Download files

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

Source Distribution

peftfactory-0.9.4.7.tar.gz (227.0 kB view details)

Uploaded Source

Built Distribution

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

peftfactory-0.9.4.7-py3-none-any.whl (315.7 kB view details)

Uploaded Python 3

File details

Details for the file peftfactory-0.9.4.7.tar.gz.

File metadata

  • Download URL: peftfactory-0.9.4.7.tar.gz
  • Upload date:
  • Size: 227.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for peftfactory-0.9.4.7.tar.gz
Algorithm Hash digest
SHA256 08a0b14e76e5ed762c6743cbaef4aa34a0f6f30310826abf8fff9a21672b0f6e
MD5 03bcfbb27510ca33a071ac9c5bbea9ef
BLAKE2b-256 3b58ebcaef6ea81a280e5c5def99203fcde52e162bd11f37f41fb8bb3e887a2e

See more details on using hashes here.

Provenance

The following attestation bundles were made for peftfactory-0.9.4.7.tar.gz:

Publisher: publish.yml on kinit-sk/PEFT-Factory

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file peftfactory-0.9.4.7-py3-none-any.whl.

File metadata

  • Download URL: peftfactory-0.9.4.7-py3-none-any.whl
  • Upload date:
  • Size: 315.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for peftfactory-0.9.4.7-py3-none-any.whl
Algorithm Hash digest
SHA256 dd289d70a10e8106ae880eee4cce47f1022048aef74abb46749231551a89f92c
MD5 bfe68e0579ce75c8f916e9dbc2858ea4
BLAKE2b-256 70007292c2b35a2705eb0aec70cbbb63577df6b43a8ee68020094d547710eacc

See more details on using hashes here.

Provenance

The following attestation bundles were made for peftfactory-0.9.4.7-py3-none-any.whl:

Publisher: publish.yml on kinit-sk/PEFT-Factory

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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