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.4.tar.gz (222.1 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.4-py3-none-any.whl (311.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: peftfactory-0.9.4.4.tar.gz
  • Upload date:
  • Size: 222.1 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.4.tar.gz
Algorithm Hash digest
SHA256 155a82fd614f6e9f368bcc60648fdaaa4e248f4e3b1cba79b64a872b164541a7
MD5 82d00e925d0dd0f96879ee1f70a3a309
BLAKE2b-256 6113c0f3c853db22d6876cd8e8b26b1e6fec68e270e32f5db5f1a88b6a3b1111

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: peftfactory-0.9.4.4-py3-none-any.whl
  • Upload date:
  • Size: 311.3 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1ae74526460983238a08c17b15c816ee932bdc5b9531e4280525a2238d9f5162
MD5 d0398906734093818fb8de1f5fc844c2
BLAKE2b-256 f134a7b00fb818421d64f2ddd60f72f2c3bdf67415e98b73e5ba14f3d42b110c

See more details on using hashes here.

Provenance

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