遇到的一些教程里沒提到的佑惠,比較簡單的問題
安裝CUDA
參考這個即可:http://www.taodudu.cc/news/show-4932223.html
torch.cuda.is_available() False
重新安裝torch后變?yōu)門rue波材,有文章提到是因為用了清華源下載舶得。
Win環(huán)境p-tuning train.sh怎么寫
首先參考教程,準(zhǔn)備好數(shù)據(jù)集 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環(huán)境p-tuning train.sh啟動
Pycharm環(huán)境切換到ptuning目錄下链韭,直接./train.sh
就行