Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/hiyouga/LLaMA-Factory into …
Browse files Browse the repository at this point in the history
…qwen2_audio
  • Loading branch information
BUAADreamer committed Jan 18, 2025
2 parents 4a5cec0 + 1f47b61 commit bf6a7b1
Show file tree
Hide file tree
Showing 57 changed files with 317 additions and 221 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ pip install .
2. Install transformers from the main branch.

```bash
git clone -b https://github.com/huggingface/transformers.git
git clone -b main https://github.com/huggingface/transformers.git
cd transformers
pip install .
```
Expand Down
2 changes: 1 addition & 1 deletion README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ pip install .
2. 安装 transformers 的 main 分支版本。

```bash
git clone -b https://github.com/huggingface/transformers.git
git clone -b main https://github.com/huggingface/transformers.git
cd transformers
pip install .
```
Expand Down
Binary file modified assets/wechat.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/wechat_npu.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions examples/extras/adam_mini/qwen2_full_sft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ bf16: true
ddp_timeout: 180000000

### eval
val_size: 0.1
per_device_eval_batch_size: 1
eval_strategy: steps
eval_steps: 500
# val_size: 0.1
# per_device_eval_batch_size: 1
# eval_strategy: steps
# eval_steps: 500
8 changes: 4 additions & 4 deletions examples/extras/apollo/llama3_full_sft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pure_bf16: true
ddp_timeout: 180000000

### eval
val_size: 0.1
per_device_eval_batch_size: 1
eval_strategy: steps
eval_steps: 500
# val_size: 0.1
# per_device_eval_batch_size: 1
# eval_strategy: steps
# eval_steps: 500
8 changes: 4 additions & 4 deletions examples/extras/badam/llama3_full_sft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ lr_scheduler_type: cosine
warmup_ratio: 0.1

### eval
val_size: 0.1
per_device_eval_batch_size: 1
eval_strategy: steps
eval_steps: 500
# val_size: 0.1
# per_device_eval_batch_size: 1
# eval_strategy: steps
# eval_steps: 500
9 changes: 5 additions & 4 deletions examples/extras/fsdp_qlora/llama3_lora_sft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ trust_remote_code: true
stage: sft
do_train: true
finetuning_type: lora
lora_rank: 8
lora_target: all

### dataset
Expand Down Expand Up @@ -35,7 +36,7 @@ bf16: true
ddp_timeout: 180000000

### eval
val_size: 0.1
per_device_eval_batch_size: 1
eval_strategy: steps
eval_steps: 500
# val_size: 0.1
# per_device_eval_batch_size: 1
# eval_strategy: steps
# eval_steps: 500
8 changes: 4 additions & 4 deletions examples/extras/galore/llama3_full_sft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pure_bf16: true
ddp_timeout: 180000000

### eval
val_size: 0.1
per_device_eval_batch_size: 1
eval_strategy: steps
eval_steps: 500
# val_size: 0.1
# per_device_eval_batch_size: 1
# eval_strategy: steps
# eval_steps: 500
8 changes: 4 additions & 4 deletions examples/extras/llama_pro/llama3_freeze_sft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ bf16: true
ddp_timeout: 180000000

### eval
val_size: 0.1
per_device_eval_batch_size: 1
eval_strategy: steps
eval_steps: 500
# val_size: 0.1
# per_device_eval_batch_size: 1
# eval_strategy: steps
# eval_steps: 500
9 changes: 5 additions & 4 deletions examples/extras/loraplus/llama3_lora_sft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ trust_remote_code: true
stage: sft
do_train: true
finetuning_type: lora
lora_rank: 8
lora_target: all
loraplus_lr_ratio: 16.0

Expand Down Expand Up @@ -35,7 +36,7 @@ bf16: true
ddp_timeout: 180000000

### eval
val_size: 0.1
per_device_eval_batch_size: 1
eval_strategy: steps
eval_steps: 500
# val_size: 0.1
# per_device_eval_batch_size: 1
# eval_strategy: steps
# eval_steps: 500
8 changes: 4 additions & 4 deletions examples/extras/mod/llama3_full_sft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pure_bf16: true
ddp_timeout: 180000000

### eval
val_size: 0.1
per_device_eval_batch_size: 1
eval_strategy: steps
eval_steps: 500
# val_size: 0.1
# per_device_eval_batch_size: 1
# eval_strategy: steps
# eval_steps: 500
9 changes: 5 additions & 4 deletions examples/extras/pissa/llama3_lora_sft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ trust_remote_code: true
stage: sft
do_train: true
finetuning_type: lora
lora_rank: 8
lora_target: all
pissa_init: true
pissa_iter: 16
Expand Down Expand Up @@ -37,7 +38,7 @@ bf16: true
ddp_timeout: 180000000

### eval
val_size: 0.1
per_device_eval_batch_size: 1
eval_strategy: steps
eval_steps: 500
# val_size: 0.1
# per_device_eval_batch_size: 1
# eval_strategy: steps
# eval_steps: 500
8 changes: 4 additions & 4 deletions examples/train_full/llama3_full_sft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ bf16: true
ddp_timeout: 180000000

### eval
val_size: 0.1
per_device_eval_batch_size: 1
eval_strategy: steps
eval_steps: 500
# val_size: 0.1
# per_device_eval_batch_size: 1
# eval_strategy: steps
# eval_steps: 500
10 changes: 6 additions & 4 deletions examples/train_full/qwen2vl_full_sft.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
### model
model_name_or_path: Qwen/Qwen2-VL-7B-Instruct
image_resolution: 262144
video_resolution: 16384
trust_remote_code: true

### method
Expand Down Expand Up @@ -37,7 +39,7 @@ bf16: true
ddp_timeout: 180000000

### eval
val_size: 0.1
per_device_eval_batch_size: 1
eval_strategy: steps
eval_steps: 500
# val_size: 0.1
# per_device_eval_batch_size: 1
# eval_strategy: steps
# eval_steps: 500
9 changes: 5 additions & 4 deletions examples/train_lora/llama3_lora_dpo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ trust_remote_code: true
stage: dpo
do_train: true
finetuning_type: lora
lora_rank: 8
lora_target: all
pref_beta: 0.1
pref_loss: sigmoid # choices: [sigmoid (dpo), orpo, simpo]
Expand Down Expand Up @@ -36,7 +37,7 @@ bf16: true
ddp_timeout: 180000000

### eval
val_size: 0.1
per_device_eval_batch_size: 1
eval_strategy: steps
eval_steps: 500
# val_size: 0.1
# per_device_eval_batch_size: 1
# eval_strategy: steps
# eval_steps: 500
9 changes: 5 additions & 4 deletions examples/train_lora/llama3_lora_kto.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ trust_remote_code: true
stage: kto
do_train: true
finetuning_type: lora
lora_rank: 8
lora_target: all
pref_beta: 0.1

Expand Down Expand Up @@ -35,7 +36,7 @@ bf16: true
ddp_timeout: 180000000

### eval
val_size: 0.1
per_device_eval_batch_size: 1
eval_strategy: steps
eval_steps: 500
# val_size: 0.1
# per_device_eval_batch_size: 1
# eval_strategy: steps
# eval_steps: 500
1 change: 1 addition & 0 deletions examples/train_lora/llama3_lora_ppo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ trust_remote_code: true
stage: ppo
do_train: true
finetuning_type: lora
lora_rank: 8
lora_target: all

### dataset
Expand Down
9 changes: 5 additions & 4 deletions examples/train_lora/llama3_lora_pretrain.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ trust_remote_code: true
stage: pt
do_train: true
finetuning_type: lora
lora_rank: 8
lora_target: all

### dataset
Expand Down Expand Up @@ -33,7 +34,7 @@ bf16: true
ddp_timeout: 180000000

### eval
val_size: 0.1
per_device_eval_batch_size: 1
eval_strategy: steps
eval_steps: 500
# val_size: 0.1
# per_device_eval_batch_size: 1
# eval_strategy: steps
# eval_steps: 500
9 changes: 5 additions & 4 deletions examples/train_lora/llama3_lora_reward.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ trust_remote_code: true
stage: rm
do_train: true
finetuning_type: lora
lora_rank: 8
lora_target: all

### dataset
Expand Down Expand Up @@ -34,7 +35,7 @@ bf16: true
ddp_timeout: 180000000

### eval
val_size: 0.1
per_device_eval_batch_size: 1
eval_strategy: steps
eval_steps: 500
# val_size: 0.1
# per_device_eval_batch_size: 1
# eval_strategy: steps
# eval_steps: 500
9 changes: 5 additions & 4 deletions examples/train_lora/llama3_lora_sft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ trust_remote_code: true
stage: sft
do_train: true
finetuning_type: lora
lora_rank: 8
lora_target: all

### dataset
Expand Down Expand Up @@ -34,7 +35,7 @@ bf16: true
ddp_timeout: 180000000

### eval
val_size: 0.1
per_device_eval_batch_size: 1
eval_strategy: steps
eval_steps: 500
# val_size: 0.1
# per_device_eval_batch_size: 1
# eval_strategy: steps
# eval_steps: 500
9 changes: 5 additions & 4 deletions examples/train_lora/llama3_lora_sft_ds3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ trust_remote_code: true
stage: sft
do_train: true
finetuning_type: lora
lora_rank: 8
lora_target: all
deepspeed: examples/deepspeed/ds_z3_config.json # choices: [ds_z0_config.json, ds_z2_config.json, ds_z3_config.json]

Expand Down Expand Up @@ -35,7 +36,7 @@ bf16: true
ddp_timeout: 180000000

### eval
val_size: 0.1
per_device_eval_batch_size: 1
eval_strategy: steps
eval_steps: 500
# val_size: 0.1
# per_device_eval_batch_size: 1
# eval_strategy: steps
# eval_steps: 500
23 changes: 12 additions & 11 deletions examples/train_lora/llama3_lora_sft_ray.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ trust_remote_code: true
stage: sft
do_train: true
finetuning_type: lora
lora_rank: 8
lora_target: all

### dataset
Expand All @@ -24,6 +25,13 @@ save_steps: 500
plot_loss: true
overwrite_output_dir: true

### ray
ray_run_name: llama3_8b_sft_lora
ray_num_workers: 4 # number of GPUs to use
resources_per_worker:
GPU: 1
placement_strategy: PACK

### train
per_device_train_batch_size: 1
gradient_accumulation_steps: 8
Expand All @@ -35,14 +43,7 @@ bf16: true
ddp_timeout: 180000000

### eval
val_size: 0.1
per_device_eval_batch_size: 1
eval_strategy: steps
eval_steps: 500

### ray
ray_run_name: llama3_8b_sft_lora
ray_num_workers: 4 # number of GPUs to use
resources_per_worker:
GPU: 1
placement_strategy: PACK
# val_size: 0.1
# per_device_eval_batch_size: 1
# eval_strategy: steps
# eval_steps: 500
1 change: 1 addition & 0 deletions examples/train_lora/llama3_preprocess.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ trust_remote_code: true
stage: sft
do_train: true
finetuning_type: lora
lora_rank: 8
lora_target: all

### dataset
Expand Down
11 changes: 7 additions & 4 deletions examples/train_lora/llava1_5_lora_sft.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
### model
model_name_or_path: llava-hf/llava-1.5-7b-hf
image_resolution: 262144
video_resolution: 16384
trust_remote_code: true

### method
stage: sft
do_train: true
finetuning_type: lora
lora_rank: 8
lora_target: all

### dataset
Expand Down Expand Up @@ -34,7 +37,7 @@ bf16: true
ddp_timeout: 180000000

### eval
val_size: 0.1
per_device_eval_batch_size: 1
eval_strategy: steps
eval_steps: 500
# val_size: 0.1
# per_device_eval_batch_size: 1
# eval_strategy: steps
# eval_steps: 500
Loading

0 comments on commit bf6a7b1

Please sign in to comment.