Commit f6f5b435 authored by chenych's avatar chenych
Browse files

Fix bugs

parent dbcc8b8d
...@@ -163,7 +163,7 @@ cd finetune ...@@ -163,7 +163,7 @@ cd finetune
``` ```
2. 配置文件位于[configs](./finetune/configs/)目录下,包括以下文件: 2. 配置文件位于[configs](./finetune/configs/)目录下,包括以下文件:
- `deepspeed配置文件`[ds_zereo_2](./finetune/configs/ds_zereo_2.json)[ds_zereo_3](./finetune/configs/ds_zereo_3.json) - `deepspeed配置文件`[ds_zero_2](./finetune/configs/ds_zero_2.json)[ds_zero_3](./finetune/configs/ds_zero_3.json)
- `lora.yaml/ sft.yaml`: 模型不同方式的配置文件,包括模型参数、优化器参数、训练参数等。部分重要参数解释如下: - `lora.yaml/ sft.yaml`: 模型不同方式的配置文件,包括模型参数、优化器参数、训练参数等。部分重要参数解释如下:
+ data_config 部分 + data_config 部分
+ train_file: 训练数据集的文件路径。 + train_file: 训练数据集的文件路径。
...@@ -202,16 +202,24 @@ cd finetune ...@@ -202,16 +202,24 @@ cd finetune
+ token_dim: 256: P-TuningV2 的 token 维度(不要改动)。 + token_dim: 256: P-TuningV2 的 token 维度(不要改动)。
#### 单机单卡 #### 单机单卡
> 注意:此方法不支持全参微调
```shell ```shell
# For Chat Fine-tune # For Chat Fine-tune
python finetune.py data/AdvertiseGen/ THUDM/GLM-4-9B-0414 configs/lora.yaml export HIP_VISIBLE_DEVICES=1 # 可自行修改为指定显卡号
export HSA_FORCE_FINE_GRAIN_PCIE=1
python finetune.py ../data/AdvertiseGen/saves/ THUDM/GLM-4-9B-0414 configs/lora.yaml
``` ```
#### 单机多卡/多机多卡 #### 单机多卡/多机多卡
这里使用`deepspeed`作为加速方案,请确认当前环境已经根据[环境配置章节](#环境配置)安装好了`deepspeed`库。 这里使用`deepspeed`作为加速方案,请确认当前环境已经根据[环境配置章节](#环境配置)安装好了`deepspeed`库。
```shell ```shell
# For Chat Fine-tune # For Chat Fine-tune
OMP_NUM_THREADS=1 torchrun --standalone --nnodes=1 --nproc_per_node=8 finetune.py data/AdvertiseGen/ THUDM/GLM-4-9B-0414 configs/lora.yaml # For Chat Fine-tune export HIP_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 # 可自行修改为指定显卡号
export HSA_FORCE_FINE_GRAIN_PCIE=1
OMP_NUM_THREADS=1 torchrun --standalone --nnodes=1 --nproc_per_node=8 finetune.py ../data/AdvertiseGen/saves THUDM/GLM-4-9B-0414 configs/lora.yaml # For Chat Fine-tune
``` ```
#### 从保存点进行微调 #### 从保存点进行微调
......
...@@ -8,7 +8,7 @@ combine: True ...@@ -8,7 +8,7 @@ combine: True
freezeV: True freezeV: True
max_input_length: 512 max_input_length: 512
max_output_length: 512 max_output_length: 512
# swanlab: "local" # set to local if don`t use cloud swanlab: "local" # set to local if don`t use cloud
training_args: training_args:
# see `transformers.Seq2SeqTrainingArguments` # see `transformers.Seq2SeqTrainingArguments`
......
...@@ -8,7 +8,7 @@ combine: True ...@@ -8,7 +8,7 @@ combine: True
freezeV: True freezeV: True
max_input_length: 512 max_input_length: 512
max_output_length: 512 max_output_length: 512
# swanlab: "local" # set to local if don`t use cloud swanlab: "local" # set to local if don`t use cloud
training_args: training_args:
# see `transformers.Seq2SeqTrainingArguments` # see `transformers.Seq2SeqTrainingArguments`
......
...@@ -6,3 +6,4 @@ rouge_chinese==1.0.3 ...@@ -6,3 +6,4 @@ rouge_chinese==1.0.3
ruamel.yaml>=0.18.6 ruamel.yaml>=0.18.6
typer>=0.13.0 typer>=0.13.0
tqdm>=4.67.0 tqdm>=4.67.0
mpi4py
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment