fix install to work with latest alpaca lora 4bit

This commit is contained in:
Wing Lian
2023-04-17 12:45:12 -04:00
parent 77fca25f1b
commit 4131183115
3 changed files with 7 additions and 8 deletions

View File

@@ -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] - 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` - Configure accelerate `accelerate config` or update `~/.cache/huggingface/accelerate/default_config.yaml`
```yaml ```yaml

View File

@@ -1,3 +1,4 @@
peft @ git+https://github.com/huggingface/peft.git
transformers @ git+https://github.com/huggingface/transformers.git transformers @ git+https://github.com/huggingface/transformers.git
attrdict attrdict
fire fire

View File

@@ -1,9 +1,9 @@
import sys
from setuptools import setup, find_packages from setuptools import setup, find_packages
install_requires = [] install_requires = []
with open("./requirements.txt", "r") as requirements_file: with open("./requirements.txt", "r") as requirements_file:
# don't include peft yet until we check the int4 # 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.strip() for r in requirements_file.readlines() if "peft" not in r]
reqs = [r for r in reqs if r[0] != "#"] reqs = [r for r in reqs if r[0] != "#"]
for r in reqs: for r in reqs:
@@ -17,14 +17,11 @@ setup(
packages=find_packages(), packages=find_packages(),
install_requires=install_requires, install_requires=install_requires,
extras_require={ extras_require={
None: [ 'int4': [
"peft @ git+https://github.com/huggingface/peft.git", "alpaca_lora_4bit @ git+https://github.com/winglian/alpaca_lora_4bit.git@setup_pip",
],
'int4_cuda': [
"alpaca_lora_4bit[cuda] @ git+https://github.com/winglian/alpaca_lora_4bit.git@setup_pip#egg=alpaca_lora_4bit[cuda]",
], ],
'int4_triton': [ '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",
], ],
}, },
) )