OpenMOSS / MOSS

An open-source tool-augmented conversational language model from Fudan University
https://txsun1997.github.io/blogs/moss.html
Apache License 2.0
11.9k stars 1.14k forks source link

在看文档时说训练sft模型时 需要将该 token 指定为<eom>,但是在哪里改呢? #276

Open gg22mm opened 1 year ago

gg22mm commented 1 year ago

在看文档时说训练sft模型时 需要将该 token 指定为< eom >,但是在哪里改呢? 图片

训练 num_machines=4 num_processes=$((num_machines * 8)) machine_rank=0
accelerate launch --config_file ./configs/sft.yaml --num_processes $num_processes --num_machines $num_machines --machine_rank $machine_rank --deepspeed_multinode_launcher standard finetune_moss.py \ --model_name_or_path fnlp/moss-moon-003-sft-plugin \ --data_dir ./sft_data --output_dir ./ckpts/moss-moon-003-sft-plugin \ --log_dir ./train_logs/moss-moon-003-sft-plugin \ --n_epochs 2 \ --train_bsz_per_gpu 1 \ --eval_bsz_per_gpu 1 \ --learning_rate 0.000015 \ --eval_step 200 \ --save_step 2000"

WenjingBao commented 1 year ago

我没搞错的话应该是finetune_moss.py的178行

tokenizer.eos_token_id = 106068 # The eos_token_id of base model is 106028. We need map the eos token to <eom> (its token id is 106068)