Fine-tuning results are not satisfactory
起始日期 | Start Date
No response
实现PR | Implementation PR
By using this script: finetune_ds.shfinetune_ds.sh
--llm_type "llama3"
--tune_vision false
--per_device_train_batch_size 2
--per_device_eval_batch_size 1
--gradient_accumulation_steps 8
--learning_rate 1e-6
--weight_decay 0
--max_grad_norm 0.1 \
Used 56K ours SFT data, but the infer results are not satisfactory.
Also, i notice "Specially, Llama3 has a different chat_template for training and inference, we modified the chat_template for training, so please take care to restore the chat_template when inference on the training ckpt." What is that meaning?
相关Issues | Reference Issues
无
摘要 | Summary
无
基本示例 | Basic Example
无
缺陷 | Drawbacks
无
未解决问题 | Unresolved questions
无
It means you should modify the chat_template to inference chat_template, because we don't need the extra <|start_header_id|>assistant<|end_header_id|>\n\n during training. You can replace the chat_template in the file tokenizer_config.json manually.
This is the chat_template for inference.
"chat_template": "{% set loop_messages = messages %}{% for message in loop_messages %}{% set content = '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n'+ message['content'] | trim + '<|eot_id|>' %}{% if loop.index0 == 0 %}{% set content = bos_token + content %}{% endif %}{{ content }}{% endfor %}{{ '<|start_header_id|>assistant<|end_header_id|>\n\n' }}"
Thank you for your quick reply, it works.