hiyouga / LLaMA-Factory

Unified Efficient Fine-Tuning of 100+ LLMs (ACL 2024)
https://arxiv.org/abs/2403.13372
Apache License 2.0
33.04k stars 4.06k forks source link

为什么用py脚本do_predict和web_demo中回答的结果不一样 #56

Closed Data2Me closed 1 year ago

Data2Me commented 1 year ago

模型是baichuan-7B 同样的问题,py脚本中do_predict的回复质量明显高于web_demo

Data2Me commented 1 year ago

并且web_demo中经常出现 "Human: " image

hljjjmssyh commented 1 year ago

看看 predict template 和 web demo template 是否一致

Data2Me commented 1 year ago

@Data2Me 问下do_predict怎么用?

python3 /mnt/cpfs/guanyutao/LLaMA-Efficient-Tuning/src/train_sft.py --model_name_or_path /model_checkpoint/baichuan-7B --do_predict --dataset dev --checkpoint_dir /baichuan-7B-lora/4200/checkpoint-4200 --output_dir /baichuan --per_device_eval_batch_size 8 --max_samples 1000 --predict_with_generate --dataset_dir /LLaMA-Efficient-Tuning/data

tszslovewanpu commented 11 months ago

我在webdemo后面加了 --prompt_template alpaca就正常了,是prompt_template的问题

请问这个参数是训练好模型,做推理的时候加的吗。如果是做inference时需要加这个参数,是不是这个模板要和训练时的一致才不会出现human?