美文网首页
ChatGLM2-6B Win本地运行和微调 记录

ChatGLM2-6B Win本地运行和微调 记录

作者: kaiker | 来源:发表于2023-08-10 01:00 被阅读0次

https://github.com/THUDM/ChatGLM2-6B

官方教程
https://www.bilibili.com/video/BV1D94y1i7Qp

遇到的一些教程里没提到的,比较简单的问题

安装CUDA

参考这个即可:http://www.taodudu.cc/news/show-4932223.html

torch.cuda.is_available() False

重新安装torch后变为True,有文章提到是因为用了清华源下载。

Win环境p-tuning train.sh怎么写

首先参考教程,准备好数据集 https://github.com/THUDM/ChatGLM2-6B/tree/main/ptuning

PRE_SEQ_LEN=128
LR=2e-2
NUM_GPUS=1

CUDA_VISIBLE_DEVICE=0 python main.py \
    --do_train \
    --train_file AdvertiseGen/train.json \
    --validation_file AdvertiseGen/dev.json \
    --preprocessing_num_workers 10 \
    --prompt_column content \
    --response_column summary \
    --overwrite_cache \
    --model_name_or_path G:\\chatglm2-6b2 \
    --output_dir output/adgen-chatglm2-6b-pt-$PRE_SEQ_LEN-$LR \
    --overwrite_output_dir \
    --max_source_length 64 \
    --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

Win环境p-tuning train.sh启动

Pycharm环境切换到ptuning目录下,直接./train.sh就行

试用


图片.png

相关文章

网友评论

      本文标题:ChatGLM2-6B Win本地运行和微调 记录

      本文链接:https://www.haomeiwen.com/subject/griapdtx.html