From 4131183115f50163a36d3887fdf05d1b0e2a6d0b Mon Sep 17 00:00:00 2001 From: Wing Lian Date: Mon, 17 Apr 2023 12:45:12 -0400 Subject: [PATCH] fix install to work with latest alpaca lora 4bit --- README.md | 3 ++- requirements.txt | 1 + setup.py | 11 ++++------- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0b74f825f..ea79cbf3a 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,8 @@ shuf -n2000 data/vicuna_cleaned.jsonl > data/vicuna_cleaned.subset0.jsonl ``` - Create a new or update the existing YAML config (config/pythia_1_2B_alpaca.yml)[config/pythia_1_2B_alpaca.yml] -- Install python dependencies `pip3 install -e .[triton]` or `pip3 install -e .[cuda]` +- Install python dependencies `pip3 install -e .[int4_triton]` or `pip3 install -e .[int4]` +- If not using `int4` or `int4_triton`, run `pip install "peft @ git+https://github.com/huggingface/peft.git"` - Configure accelerate `accelerate config` or update `~/.cache/huggingface/accelerate/default_config.yaml` ```yaml diff --git a/requirements.txt b/requirements.txt index f1db23b10..eecb41b42 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +peft @ git+https://github.com/huggingface/peft.git transformers @ git+https://github.com/huggingface/transformers.git attrdict fire diff --git a/setup.py b/setup.py index 2bb8a507e..1318c85bb 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,9 @@ -import sys from setuptools import setup, find_packages install_requires = [] with open("./requirements.txt", "r") as requirements_file: # don't include peft yet until we check the int4 + # need to manually install peft for now... reqs = [r.strip() for r in requirements_file.readlines() if "peft" not in r] reqs = [r for r in reqs if r[0] != "#"] for r in reqs: @@ -17,14 +17,11 @@ setup( packages=find_packages(), install_requires=install_requires, extras_require={ - None: [ - "peft @ git+https://github.com/huggingface/peft.git", - ], - 'int4_cuda': [ - "alpaca_lora_4bit[cuda] @ git+https://github.com/winglian/alpaca_lora_4bit.git@setup_pip#egg=alpaca_lora_4bit[cuda]", + 'int4': [ + "alpaca_lora_4bit @ git+https://github.com/winglian/alpaca_lora_4bit.git@setup_pip", ], 'int4_triton': [ - "alpaca_lora_4bit[triton] @ git+https://github.com/winglian/alpaca_lora_4bit.git@setup_pip#egg=alpaca_lora_4bit[triton]", + "alpaca_lora_4bit[triton] @ git+https://github.com/winglian/alpaca_lora_4bit.git@setup_pip", ], }, )