设置训练参数
在对客服对话完成分词后,您需要先设置训练参数,才能对预训练模型进行微调。
TrainingArguments 已为您加载。
本练习是课程的一部分
Python 中的 LLM 入门
练习说明
- 创建一个
TrainingArguments()实例。 - 将评估策略设为
"epoch"。 - 指定训练 3 个 epoch。
- 将训练和评估的批量大小都设为 3。
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Set up an instance of TrainingArguments
training_args = ____(
output_dir="./finetuned",
# Set the evaluation strategy
____,
# Specify the number of epochs
____=3,
learning_rate=2e-5,
# Set the batch sizes
____=3,
____=3,
weight_decay=0.01
)