Skip to content

Commit 41207b7

Browse files
authored
Merge pull request #3 from Alpha-VLLM/main
compare diff
2 parents cc338bb + c7d1a00 commit 41207b7

10 files changed

Lines changed: 1593 additions & 26 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
## Features
1515
* **💡Support More Datasets and Tasks**
1616
- 🎯 Pre-training with [RefinedWeb](https://huggingface.co/datasets/tiiuae/falcon-refinedweb) and [StarCoder](https://github.com/bigcode-project/starcoder).
17-
- 📚 Single-modal fine-tuning with [Alpaca](https://github.com/tatsu-lab/stanford_alpaca), [ShareGPT](https://github.com/domeccleston/sharegpt), [LIMA](https://arxiv.org/pdf/2305.11206.pdf), [WizardLM](https://github.com/nlpxucan/WizardLM), [UltraChat](https://github.com/thunlp/UltraChat) and [MOSS](https://github.com/OpenLMLab/MOSS).
17+
- 📚 Single-modal fine-tuning with [Alpaca](https://github.com/tatsu-lab/stanford_alpaca), [ShareGPT](https://github.com/domeccleston/sharegpt), [LIMA](https://arxiv.org/pdf/2305.11206.pdf), [WizardLM](https://github.com/nlpxucan/WizardLM), [Flacuna](https://github.com/declare-lab/flacuna), [Platypus](https://github.com/arielnlee/Platypus), [UltraChat](https://github.com/thunlp/UltraChat) and [MOSS](https://github.com/OpenLMLab/MOSS).
1818
- 🌈 Multi-modal fine-tuning with image-text pairs ([LAION](https://laion.ai/blog/laion-5b/), [COYO](https://github.com/kakaobrain/coyo-dataset) and more), interleaved image-text data ([MMC4](https://github.com/allenai/mmc4) and [OBELISC](https://github.com/huggingface/OBELISC)) and visual instruction data ([LLaVA](https://github.com/haotian-liu/LLaVA), [Shrika](https://github.com/shikras/shikra), [Bard](https://bard.google.com/))
1919
- 🔧 LLM for API Control ([GPT4Tools](https://github.com/StevenGrove/GPT4Tools) and [Gorilla](https://github.com/ShishirPatil/gorilla)).
2020
* **⚡Efficient Optimization and Deployment**
@@ -112,6 +112,7 @@ If you find our code and paper useful, please kindly cite:
112112
+ [@microsoft](https://github.com/microsoft) for [DeepSpeed](https://github.com/microsoft/DeepSpeed)
113113
+ [@declare-lab](https://github.com/declare-lab) for [flacuna](https://github.com/declare-lab/flacuna)
114114
+ [@nlpxucan](https://github.com/nlpxucan) for [WizardLM](https://github.com/nlpxucan/WizardLM)
115+
+ [@arielnlee](https://github.com/arielnlee) for [Platypus](https://github.com/arielnlee/Platypus)
115116
+ [@Google](https://github.com/google) for [Bard](https://bard.google.com/)
116117
</details>
117118

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
META:
2+
- ['../data/Platypus_alpaca_format.json', 'text']

accessory/demos/single_turn_mm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from util import misc
1515
from fairscale.nn.model_parallel import initialize as fs_init
1616

17-
from data.alpaca import transform_train, format_prompt
17+
from data.alpaca import transform_val, format_prompt
1818
from util.tensor_parallel import load_tensor_parallel_model
1919
from util.quant import quantize
2020

@@ -86,7 +86,7 @@ def generate(
8686
):
8787
if img_path is not None:
8888
image = Image.open(img_path).convert('RGB')
89-
image = transform_train(image).unsqueeze(0)
89+
image = transform_val(image).unsqueeze(0)
9090
else:
9191
image = None
9292

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
pretrained_path=$1
4+
pretrained_type=meta_ori
5+
llama_config="$2"
6+
tokenizer_path="$3"
7+
data_config=configs/data/finetune/sg/platypus.yaml
8+
9+
data_parallel=sdp
10+
model_parallel=1
11+
12+
exp_name=finetune/sg/platypus
13+
echo "exp name: $exp_name"
14+
mkdir -p output/"$exp_name"
15+
16+
torchrun --master_port=1112 --nproc_per_node=6 main_finetune.py \
17+
--output_dir output/"$exp_name" --epochs 4 --warmup_epochs 1 \
18+
--batch_size 4 --accum_iter 2 --num_workers 4 \
19+
--max_words 512 \
20+
--lr 0.00003 --min_lr 0.000005 --clip_grad 2 --weight_decay 0.02 \
21+
--data_parallel "$data_parallel" --model_parallel_size "$model_parallel" --checkpointing \
22+
--llama_type llama --llama_config "$llama_config" --tokenizer_path "$tokenizer_path" \
23+
--no_visual \
24+
--pretrained_path "$pretrained_path" --pretrained_type="$pretrained_type" \
25+
--data_config $data_config \
26+
2>&1 | tee -a output/"$exp_name"/output.log
27+
28+
echo "exp name: $exp_name"

accessory/tools/download.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def get_args_parser():
2020
parser.add_argument('--input_type', default='sg', choices=['sg', 'mm'])
2121
parser.add_argument('--model_size', default='7B', choices=['7B', '13B', '70B'])
2222
parser.add_argument('--down_config', action="store_true" ,help='download config')
23+
parser.add_argument('--down_diff', action="store_true" ,help='download delta weights')
2324
return parser
2425

2526
if __name__ == '__main__':
@@ -41,7 +42,10 @@ def get_args_parser():
4142
max_num = num_files_map[args.model_size]
4243

4344
for num in range(max_num):
44-
file_name = f"consolidated.{num:02d}-of-{max_num:02d}.model-diff.pth"
45+
if args.down_diff:
46+
file_name = f"consolidated.{num:02d}-of-{max_num:02d}.model-diff.pth"
47+
else:
48+
file_name = f"consolidated.{num:02d}-of-{max_num:02d}.model.pth"
4549
download_file(repo_id, subfolder, file_name, args.output_path)
4650

4751
print(f"{args.model_name} model files downloaded successfully to {args.output_path}")

0 commit comments

Comments
 (0)