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