Spaces:
Build error
Build error
llama3 r2 config
Browse files
llama-factory/config/llama3-8b_lora_sft_bf16-p1_r2.yaml
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### model
|
2 |
+
model_name_or_path: shenzhi-wang/Llama3-8B-Chinese-Chat
|
3 |
+
#model_name_or_path: FlagAlpha/Llama3-Chinese-8B-Instruct
|
4 |
+
|
5 |
+
### method
|
6 |
+
stage: sft
|
7 |
+
do_train: true
|
8 |
+
finetuning_type: lora
|
9 |
+
lora_target: all
|
10 |
+
# quantization_bit: 4 # use 4-bit QLoRA
|
11 |
+
loraplus_lr_ratio: 16.0 # use LoRA+ with lambda=16.0
|
12 |
+
# use_unsloth: true # use UnslothAI's LoRA optimization for 2x faster training
|
13 |
+
upcast_layernorm: true
|
14 |
+
|
15 |
+
### dataset
|
16 |
+
dataset: alpaca_mgtv_p1
|
17 |
+
template: llama3
|
18 |
+
cutoff_len: 8192
|
19 |
+
max_samples: 25000
|
20 |
+
overwrite_cache: true
|
21 |
+
preprocessing_num_workers: 16
|
22 |
+
|
23 |
+
### output
|
24 |
+
output_dir: saves/llama3-8b/lora/sft_bf16_p1_full_r2
|
25 |
+
logging_steps: 10
|
26 |
+
save_steps: 175
|
27 |
+
plot_loss: true
|
28 |
+
# overwrite_output_dir: true
|
29 |
+
|
30 |
+
### train
|
31 |
+
per_device_train_batch_size: 16
|
32 |
+
gradient_accumulation_steps: 8
|
33 |
+
learning_rate: 1.0e-4
|
34 |
+
num_train_epochs: 4.0
|
35 |
+
lr_scheduler_type: cosine
|
36 |
+
warmup_ratio: 0.1
|
37 |
+
bf16: true
|
38 |
+
ddp_timeout: 180000000
|
39 |
+
|
40 |
+
### eval
|
41 |
+
val_size: 0.1
|
42 |
+
per_device_eval_batch_size: 1
|
43 |
+
eval_strategy: epoch
|
44 |
+
eval_steps: 1
|
45 |
+
|
46 |
+
report_to: wandb
|
47 |
+
run_name: llama3_8b_p1_full_r2 # optional
|
llama-factory/config/llama3-8b_lora_sft_bf16-p2_r2.yaml
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### model
|
2 |
+
model_name_or_path: shenzhi-wang/Llama3-8B-Chinese-Chat
|
3 |
+
#model_name_or_path: FlagAlpha/Llama3-Chinese-8B-Instruct
|
4 |
+
|
5 |
+
### method
|
6 |
+
stage: sft
|
7 |
+
do_train: true
|
8 |
+
finetuning_type: lora
|
9 |
+
lora_target: all
|
10 |
+
# quantization_bit: 4 # use 4-bit QLoRA
|
11 |
+
loraplus_lr_ratio: 16.0 # use LoRA+ with lambda=16.0
|
12 |
+
# use_unsloth: true # use UnslothAI's LoRA optimization for 2x faster training
|
13 |
+
upcast_layernorm: true
|
14 |
+
|
15 |
+
### dataset
|
16 |
+
dataset: alpaca_mgtv_p2
|
17 |
+
template: llama3
|
18 |
+
cutoff_len: 8192
|
19 |
+
max_samples: 25000
|
20 |
+
overwrite_cache: true
|
21 |
+
preprocessing_num_workers: 16
|
22 |
+
|
23 |
+
### output
|
24 |
+
output_dir: saves/llama3-8b/lora/sft_bf16_p2_full_r2
|
25 |
+
logging_steps: 10
|
26 |
+
save_steps: 175
|
27 |
+
plot_loss: true
|
28 |
+
#overwrite_output_dir: true
|
29 |
+
|
30 |
+
### train
|
31 |
+
per_device_train_batch_size: 16
|
32 |
+
gradient_accumulation_steps: 8
|
33 |
+
learning_rate: 1.0e-4
|
34 |
+
num_train_epochs: 4.0
|
35 |
+
lr_scheduler_type: cosine
|
36 |
+
warmup_ratio: 0.1
|
37 |
+
bf16: true
|
38 |
+
ddp_timeout: 180000000
|
39 |
+
|
40 |
+
### eval
|
41 |
+
val_size: 0.1
|
42 |
+
per_device_eval_batch_size: 1
|
43 |
+
eval_strategy: epoch
|
44 |
+
eval_steps: 1
|
45 |
+
|
46 |
+
report_to: wandb
|
47 |
+
run_name: llama3_8b_p2_full_r2 # optional
|
scripts/eval-mgtv-llama3_8b.sh
CHANGED
@@ -24,13 +24,13 @@ export MODEL_NAME=shenzhi-wang/Llama3-8B-Chinese-Chat
|
|
24 |
export MODEL_PREFIX=llama3-8b_lora_sft_bf16
|
25 |
|
26 |
export LOGICAL_REASONING_RESULTS_PATH=results/$MODEL_PREFIX-p1.csv
|
27 |
-
export ADAPTER_PATH_BASE=llama-factory/saves/llama3-8b/lora/
|
28 |
export USING_P1_PROMPT_TEMPLATE=true
|
29 |
echo "Eval $MODEL_NAME with $ADAPTER_PATH_BASE"
|
30 |
python llm_toolkit/eval_logical_reasoning_all_epochs.py
|
31 |
|
32 |
export LOGICAL_REASONING_RESULTS_PATH=results/$MODEL_PREFIX-p2.csv
|
33 |
-
export ADAPTER_PATH_BASE=llama-factory/saves/llama3-8b/lora/
|
34 |
export USING_P1_PROMPT_TEMPLATE=false
|
35 |
echo "Eval $MODEL_NAME with $ADAPTER_PATH_BASE"
|
36 |
python llm_toolkit/eval_logical_reasoning_all_epochs.py
|
|
|
24 |
export MODEL_PREFIX=llama3-8b_lora_sft_bf16
|
25 |
|
26 |
export LOGICAL_REASONING_RESULTS_PATH=results/$MODEL_PREFIX-p1.csv
|
27 |
+
export ADAPTER_PATH_BASE=llama-factory/saves/llama3-8b/lora/sft_bf16_p1_full_r2
|
28 |
export USING_P1_PROMPT_TEMPLATE=true
|
29 |
echo "Eval $MODEL_NAME with $ADAPTER_PATH_BASE"
|
30 |
python llm_toolkit/eval_logical_reasoning_all_epochs.py
|
31 |
|
32 |
export LOGICAL_REASONING_RESULTS_PATH=results/$MODEL_PREFIX-p2.csv
|
33 |
+
export ADAPTER_PATH_BASE=llama-factory/saves/llama3-8b/lora/sft_bf16_p2_full_r2
|
34 |
export USING_P1_PROMPT_TEMPLATE=false
|
35 |
echo "Eval $MODEL_NAME with $ADAPTER_PATH_BASE"
|
36 |
python llm_toolkit/eval_logical_reasoning_all_epochs.py
|
scripts/tune-mgtv-llama3_8b.sh
CHANGED
@@ -25,15 +25,14 @@ export MODEL_NAME=shenzhi-wang/Llama3-8B-Chinese-Chat
|
|
25 |
|
26 |
export MODEL_PREFIX=llama3-8b_lora_sft_bf16
|
27 |
|
28 |
-
export CONFIG_FILE=config/$MODEL_PREFIX-
|
29 |
echo "Tuning $MODEL_NAME with $CONFIG_FILE"
|
30 |
$BASEDIR/scripts/tune-lf.sh $CONFIG_FILE
|
31 |
|
32 |
|
33 |
-
export CONFIG_FILE=config/$MODEL_PREFIX-
|
34 |
echo "Tuning $MODEL_NAME with $CONFIG_FILE"
|
35 |
$BASEDIR/scripts/tune-lf.sh $CONFIG_FILE
|
36 |
|
37 |
|
38 |
$BASEDIR/scripts/eval-mgtv-llama3_8b.sh
|
39 |
-
|
|
|
25 |
|
26 |
export MODEL_PREFIX=llama3-8b_lora_sft_bf16
|
27 |
|
28 |
+
export CONFIG_FILE=config/$MODEL_PREFIX-p1_r2.yaml
|
29 |
echo "Tuning $MODEL_NAME with $CONFIG_FILE"
|
30 |
$BASEDIR/scripts/tune-lf.sh $CONFIG_FILE
|
31 |
|
32 |
|
33 |
+
export CONFIG_FILE=config/$MODEL_PREFIX-p2_r2.yaml
|
34 |
echo "Tuning $MODEL_NAME with $CONFIG_FILE"
|
35 |
$BASEDIR/scripts/tune-lf.sh $CONFIG_FILE
|
36 |
|
37 |
|
38 |
$BASEDIR/scripts/eval-mgtv-llama3_8b.sh
|
|