Spaces:
Build error
Build error
r3: hfl/llama-3-chinese-8b-instruct-v3
Browse files- competition/00d_Llama3_Results.ipynb +0 -0
- competition/11b_Llama-3_8b_p1_en_analysis.ipynb +0 -0
- competition/11b_Llama-3_8b_p2_en_analysis.ipynb +0 -0
- llama-factory/config/llama3-8b_lora_sft_bf16-p1_r3.yaml +46 -0
- llama-factory/config/llama3-8b_lora_sft_bf16-p2_r3.yaml +46 -0
- results/mgtv-llama3_p1_en_full_metrics.csv +4 -0
- results/mgtv-llama3_p2_en_full_metrics.csv +4 -0
- scripts/eval-mgtv-llama3_8b.sh +7 -5
- scripts/tune-mgtv-llama3_8b.sh +2 -2
competition/00d_Llama3_Results.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
competition/11b_Llama-3_8b_p1_en_analysis.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
competition/11b_Llama-3_8b_p2_en_analysis.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
llama-factory/config/llama3-8b_lora_sft_bf16-p1_r3.yaml
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### model
|
2 |
+
model_name_or_path: hfl/llama-3-chinese-8b-instruct-v3
|
3 |
+
|
4 |
+
### method
|
5 |
+
stage: sft
|
6 |
+
do_train: true
|
7 |
+
finetuning_type: lora
|
8 |
+
lora_target: all
|
9 |
+
# quantization_bit: 4 # use 4-bit QLoRA
|
10 |
+
loraplus_lr_ratio: 16.0 # use LoRA+ with lambda=16.0
|
11 |
+
# use_unsloth: true # use UnslothAI's LoRA optimization for 2x faster training
|
12 |
+
upcast_layernorm: true
|
13 |
+
|
14 |
+
### dataset
|
15 |
+
dataset: alpaca_mgtv_p1
|
16 |
+
template: llama3
|
17 |
+
cutoff_len: 4096
|
18 |
+
max_samples: 25000
|
19 |
+
overwrite_cache: true
|
20 |
+
preprocessing_num_workers: 16
|
21 |
+
|
22 |
+
### output
|
23 |
+
output_dir: saves/llama3-8b/lora/sft_bf16_p1_full_r3
|
24 |
+
logging_steps: 10
|
25 |
+
save_steps: 35
|
26 |
+
plot_loss: true
|
27 |
+
# overwrite_output_dir: true
|
28 |
+
|
29 |
+
### train
|
30 |
+
per_device_train_batch_size: 16
|
31 |
+
gradient_accumulation_steps: 8
|
32 |
+
learning_rate: 1.0e-4
|
33 |
+
num_train_epochs: 1.0
|
34 |
+
lr_scheduler_type: cosine
|
35 |
+
warmup_ratio: 0.1
|
36 |
+
bf16: true
|
37 |
+
ddp_timeout: 180000000
|
38 |
+
|
39 |
+
### eval
|
40 |
+
val_size: 0.1
|
41 |
+
per_device_eval_batch_size: 1
|
42 |
+
eval_strategy: steps
|
43 |
+
eval_steps: 35
|
44 |
+
|
45 |
+
report_to: wandb
|
46 |
+
run_name: llama3_8b_p1_full_r3 # optional
|
llama-factory/config/llama3-8b_lora_sft_bf16-p2_r3.yaml
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### model
|
2 |
+
model_name_or_path: hfl/llama-3-chinese-8b-instruct-v3
|
3 |
+
|
4 |
+
### method
|
5 |
+
stage: sft
|
6 |
+
do_train: true
|
7 |
+
finetuning_type: lora
|
8 |
+
lora_target: all
|
9 |
+
# quantization_bit: 4 # use 4-bit QLoRA
|
10 |
+
loraplus_lr_ratio: 16.0 # use LoRA+ with lambda=16.0
|
11 |
+
# use_unsloth: true # use UnslothAI's LoRA optimization for 2x faster training
|
12 |
+
upcast_layernorm: true
|
13 |
+
|
14 |
+
### dataset
|
15 |
+
dataset: alpaca_mgtv_p2
|
16 |
+
template: llama3
|
17 |
+
cutoff_len: 4096
|
18 |
+
max_samples: 25000
|
19 |
+
overwrite_cache: true
|
20 |
+
preprocessing_num_workers: 16
|
21 |
+
|
22 |
+
### output
|
23 |
+
output_dir: saves/llama3-8b/lora/sft_bf16_p2_full_r3
|
24 |
+
logging_steps: 10
|
25 |
+
save_steps: 35
|
26 |
+
plot_loss: true
|
27 |
+
# overwrite_output_dir: true
|
28 |
+
|
29 |
+
### train
|
30 |
+
per_device_train_batch_size: 16
|
31 |
+
gradient_accumulation_steps: 8
|
32 |
+
learning_rate: 1.0e-4
|
33 |
+
num_train_epochs: 1.0
|
34 |
+
lr_scheduler_type: cosine
|
35 |
+
warmup_ratio: 0.1
|
36 |
+
bf16: true
|
37 |
+
ddp_timeout: 180000000
|
38 |
+
|
39 |
+
### eval
|
40 |
+
val_size: 0.1
|
41 |
+
per_device_eval_batch_size: 1
|
42 |
+
eval_strategy: steps
|
43 |
+
eval_steps: 35
|
44 |
+
|
45 |
+
report_to: wandb
|
46 |
+
run_name: llama3_8b_p2_full_r3 # optional
|
results/mgtv-llama3_p1_en_full_metrics.csv
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
epoch,model,accuracy,precision,recall,f1
|
2 |
+
0.3333333333333333,meta-llama/Meta-Llama-3-8B-Instruct/checkpoint-117_torch.bfloat16_lf,0.6486666666666666,0.6525934632970077,0.6486666666666666,0.6312721163517108
|
3 |
+
0.6666666666666666,meta-llama/Meta-Llama-3-8B-Instruct/checkpoint-234_torch.bfloat16_lf,0.561,0.6897096276142071,0.561,0.6083393704375663
|
4 |
+
1.0,meta-llama/Meta-Llama-3-8B-Instruct/checkpoint-351_torch.bfloat16_lf,0.621,0.686842945161901,0.621,0.6417441253605001
|
results/mgtv-llama3_p2_en_full_metrics.csv
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
epoch,model,accuracy,precision,recall,f1
|
2 |
+
0.3333333333333333,meta-llama/Meta-Llama-3-8B-Instruct/checkpoint-117_torch.bfloat16_lf,0.6203333333333333,0.663582082981778,0.6203333333333333,0.6363626392286635
|
3 |
+
0.6666666666666666,meta-llama/Meta-Llama-3-8B-Instruct/checkpoint-234_torch.bfloat16_lf,0.5613333333333334,0.7000506187405509,0.5613333333333334,0.6113039056178092
|
4 |
+
1.0,meta-llama/Meta-Llama-3-8B-Instruct/checkpoint-351_torch.bfloat16_lf,0.6203333333333333,0.6819200833733873,0.6203333333333333,0.6405153767205392
|
scripts/eval-mgtv-llama3_8b.sh
CHANGED
@@ -21,17 +21,19 @@ export RESIZE_TOKEN_EMBEDDINGS=true
|
|
21 |
export START_EPOCH=0
|
22 |
export USING_LLAMA_FACTORY=true
|
23 |
|
24 |
-
export MODEL_NAME=shenzhi-wang/Llama3-8B-Chinese-Chat
|
|
|
|
|
25 |
export MODEL_PREFIX=llama3-8b_lora_sft_bf16
|
26 |
|
27 |
-
export LOGICAL_REASONING_RESULTS_PATH=results/$MODEL_PREFIX-
|
28 |
-
export ADAPTER_PATH_BASE=llama-factory/saves/llama3-8b/lora/
|
29 |
export USING_P1_PROMPT_TEMPLATE=true
|
30 |
echo "Eval $MODEL_NAME with $ADAPTER_PATH_BASE"
|
31 |
python llm_toolkit/eval_logical_reasoning_all_epochs.py
|
32 |
|
33 |
-
export LOGICAL_REASONING_RESULTS_PATH=results/$MODEL_PREFIX-
|
34 |
-
export ADAPTER_PATH_BASE=llama-factory/saves/llama3-8b/lora/
|
35 |
export USING_P1_PROMPT_TEMPLATE=false
|
36 |
echo "Eval $MODEL_NAME with $ADAPTER_PATH_BASE"
|
37 |
python llm_toolkit/eval_logical_reasoning_all_epochs.py
|
|
|
21 |
export START_EPOCH=0
|
22 |
export USING_LLAMA_FACTORY=true
|
23 |
|
24 |
+
# export MODEL_NAME=shenzhi-wang/Llama3-8B-Chinese-Chat
|
25 |
+
export MODEL_NAME=hfl/llama-3-chinese-8b-instruct-v3
|
26 |
+
|
27 |
export MODEL_PREFIX=llama3-8b_lora_sft_bf16
|
28 |
|
29 |
+
export LOGICAL_REASONING_RESULTS_PATH=results/$MODEL_PREFIX-p1_r3.csv
|
30 |
+
export ADAPTER_PATH_BASE=llama-factory/saves/llama3-8b/lora/sft_bf16_p1_full_r3
|
31 |
export USING_P1_PROMPT_TEMPLATE=true
|
32 |
echo "Eval $MODEL_NAME with $ADAPTER_PATH_BASE"
|
33 |
python llm_toolkit/eval_logical_reasoning_all_epochs.py
|
34 |
|
35 |
+
export LOGICAL_REASONING_RESULTS_PATH=results/$MODEL_PREFIX-p2_r3.csv
|
36 |
+
export ADAPTER_PATH_BASE=llama-factory/saves/llama3-8b/lora/sft_bf16_p2_full_r3
|
37 |
export USING_P1_PROMPT_TEMPLATE=false
|
38 |
echo "Eval $MODEL_NAME with $ADAPTER_PATH_BASE"
|
39 |
python llm_toolkit/eval_logical_reasoning_all_epochs.py
|
scripts/tune-mgtv-llama3_8b.sh
CHANGED
@@ -25,12 +25,12 @@ 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 |
|
|
|
25 |
|
26 |
export MODEL_PREFIX=llama3-8b_lora_sft_bf16
|
27 |
|
28 |
+
export CONFIG_FILE=config/$MODEL_PREFIX-p1_r3.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_r3.yaml
|
34 |
echo "Tuning $MODEL_NAME with $CONFIG_FILE"
|
35 |
$BASEDIR/scripts/tune-lf.sh $CONFIG_FILE
|
36 |
|