forked from Lightning-AI/litgpt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfinetune-llama2.sh
23 lines (22 loc) · 1.17 KB
/
finetune-llama2.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
hf_repo_author="meta-llama"
hf_repo_name="Llama-2-7b-hf"
rz_repo_id="llama7b-instruct-lora-nf4-subj-eval"
dir_name="thesis"
# https://cdn.discordapp.com/attachments/1003310779157725194/1190165631086120960/data.json for qg data
# https://cdn.discordapp.com/attachments/833018351009529856/1189824144754352188/data.json for eval data
data_file_url="https://cdn.discordapp.com/attachments/1003310779157725194/1190563478814072892/train.json"
cd workspace
mkdir $dir_name
cd $dir_name
git clone https://github.com/Reinforz/lit-gpt .
git pull
pip install -r requirements-all.txt
python scripts/download.py \
--repo_id $hf_repo_author/$hf_repo_name --access_token $HUGGINGFACE_TOKEN
python scripts/convert_hf_checkpoint.py \
--checkpoint_dir checkpoints/$hf_repo_author/$hf_repo_name
curl -s $data_file_url -o /$dir_name/data.json
python scripts/prepare_alpaca.py \
--data_file_name data.json --destination_path /$dir_name --checkpoint_dir checkpoints/$hf_repo_author/$hf_repo_name
python finetune/lora.py \
--checkpoint_dir checkpoints/$hf_repo_author/$hf_repo_name/ --precision bf16-true --quantize "bnb.nf4" --data_dir /$dir_name --out_dir out/$hf_repo_author --repo_id reinforz/$rz_repo_id