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.

Installation

⚠️ Currently, the best way is to install from this repository. This will change soon.

Clone the repository

git clone git@github.com:Wicwik/PEFT-Factory.git

Build the wheel

make build

Install wiht pip

pip install dist/llamafactory-0.9.4.dev0-py3-none-any.whl

Quickstart

Quick start of prefix tuning with LLaMa3-8B-Instruct for CB dataset. We are using the template from examples directory, but feel free to use your own config.yml.

Create some variables for envsubst

TIMESTAMP=`date +%s`
OUTPUT_DIR="saves/prefix-tuning/llama-3-8b-instruct/train_cb_${TIMESTAMP}"
DATASET="cb"
SEED=123
WANDB_PROJECT="peft-factory-train-prefix-tuning"
WANDB_NAME="prefix-tuning_llama-3-8b-instruct_train_cb"

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/prefix-tuning/llama-3-8b-instruct/train.yaml > ${OUTPUT_DIR}/train.yaml

Run the factory

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

Supported methods

PEFT method name Support
LoRA (including variants) ✅ 🦙
Prefix Tuning ✅ 🤗
Prompt Tuning ✅ 🤗
P-Tuning ✅ 🤗
LNTuning ✅ 🤗
SVD ✅ ⚙️
BitFit ✅ ⚙️

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.6.tar.gz (225.6 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.6-py3-none-any.whl (314.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: peftfactory-0.9.4.6.tar.gz
  • Upload date:
  • Size: 225.6 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.6.tar.gz
Algorithm Hash digest
SHA256 7b38841cae1f6f567013df876c126c7138c1c0990366f01a107a9d2c6e6411e0
MD5 0ecbbf5ab40f254b75f01cd8ccbce754
BLAKE2b-256 a2ba46ad1ec7607d12a50190c72fbea5c38fa982d17af8a961d9a750a12706f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for peftfactory-0.9.4.6.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.6-py3-none-any.whl.

File metadata

  • Download URL: peftfactory-0.9.4.6-py3-none-any.whl
  • Upload date:
  • Size: 314.8 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 25763b799438553bab77345b1154fe78c4153de3395623ad70fcc620cb9092d0
MD5 145f171f45d7a06ebd0bcaadc1de658d
BLAKE2b-256 71cf3671156ff65d180bfd0351916c25fce26130da089c7a5c47cbd67a3f41f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for peftfactory-0.9.4.6-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