[THUDM/ChatGLM-6B]P-tuning v2微调后只响应训练数据

2024-05-20 3 views
1

P-tuning v2微调后,无论输入什么问题,都只响应训练的数据,即便这个问题是没训练过的/训练的数据只有一条,原有6B模型的内容好像都被覆盖了。我看其他issue有同样的问题,想知道如何解决或者是变相解决的解决方案

正确的输出是不是应该在原有6B的基础上,增加了我想要的定制数据,即在他原有能力的基础上,丰富了一些个性化的问题的答案

train.sh: PRE_SEQ_LEN=128 LR=2e-2

CUDA_VISIBLE_DEVICES=0 python main.py \ --do_train \ --train_file medical/train.json \ --validation_file medical/dev.json \ --prompt_column content \ --response_column summary \ --overwrite_cache \ --model_name_or_path C:\ddwork\workspace\pycharm\ChatGLM-6B-main\chatglm-6b-int4 \ --output_dir output/adgen-chatglm-6b-pt-$PRE_SEQ_LEN-$LR \ --overwrite_output_dir \ --max_source_length 128 \ --max_target_length 128 \ --per_device_train_batch_size 1 \ --per_device_eval_batch_size 1 \ --gradient_accumulation_steps 16 \ --predict_with_generate \ --max_steps 3000 \ --logging_steps 10 \ --save_steps 1000 \ --learning_rate $LR \ --pre_seq_len $PRE_SEQ_LEN \ --quantization_bit 4

web_demo.sh: PRE_SEQ_LEN=128

CUDA_VISIBLE_DEVICES=0 python web_demo.py \ --model_name_or_path C:\ddwork\workspace\pycharm\ChatGLM-6B-main\chatglm-6b-int4 \ --ptuning_checkpoint output/adgen-chatglm-6b-pt-128-2e-2/checkpoint-3000 \ --pre_seq_len $PRE_SEQ_LEN

Environment
- OS:
- Python:
- Transformers:
- PyTorch:
- CUDA Support (`python -c "import torch; print(torch.cuda.is_available())"`) :

回答

5

遇到了同样问题,原有信息全部遗忘了。。。

6

+1 我也是 ,,怎么处理啊? 着急

4

Duplicate of #403