ChatGLM-6B icon indicating copy to clipboard operation
ChatGLM-6B copied to clipboard

怎么样先做一次微调,然后在此基础上做第二次微调?[BUG/Help] <title>

Open MathamPollard opened this issue 1 year ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

请问一下怎么样先用100万条数据微调,再用1万条数据微调?就是说,100条数据微调后,有两种checkpoint,一个是官方的,一个是本地的用100万数据训练的checkpoint,那么怎么利用这两个checkpoint做第二次微调呢?代码要怎么更改?

Expected Behavior

none

Steps To Reproduce

none

Environment

- OS: ubantu18.04
- Python: 3.10
- Transformers:4.29.2
- PyTorch:1.12.1
- CUDA Support (`python -c "import torch; print(torch.cuda.is_available())"`) :
11.3
True

Anything else?

none

MathamPollard avatar May 27 '23 10:05 MathamPollard

最关键的是,怎么样先把原模型参数和第一次微调得到的checkpoint合并起来,再做第二次微调?还是说,在做第二次微调时,model_path_or_name这个参数指定的是第一次微调的checkpoint(意思就是把第一次微调后得到的pytorch_model.bin替换原来的pytorch_model.bin),由此在第一次微调的基础上得到第二次微调checkpoint,最后在推理时,再把model_path_or_name指定为原模型的路径。是这样吗??

MathamPollard avatar May 27 '23 16:05 MathamPollard

train.sh中加一个参数--ptuning_checkpoint "output/insurance-chatglm-6b-pt-512-2e-2/checkpoint-20"

hongshuo-wang avatar May 30 '23 02:05 hongshuo-wang

train.sh中加一个参数--ptuning_checkpoint "output/insurance-chatglm-6b-pt-512-2e-2/checkpoint-20"

想请问您一下,通过这种方法是否遇到继续微调loss不下降的情况?我这边使用checkpoint继续微调就会出现loss不下降,训练没有效果的情况

logan-zou avatar May 31 '23 11:05 logan-zou