定义自定义配方
您正在为一位客户微调一个预训练的 Llama 模型,该客户需要特定配置。您的计划是使用 TorchTune 进行微调,因此需要准备一个 Python 字典,用来存储将用于运行微调任务的自定义配方需求。
本练习是课程的一部分
使用 Llama 3 进行微调
练习说明
- 在您的字典中写入客户需求:首先,添加
torchtune.models.llama3_2.llama3_2_1b模型。 - 添加批大小为 8以及GPU 设备。
交互式实操练习
通过完成这段示例代码来试试这个练习。
config_dict = {
# Define the model
____,
# Define the batch size
____,
# Define the device type
____,
"epochs": 15,
"optimizer": {"_component_": "bitsandbytes.optim.PagedAdamW8bit", "lr": 3e-05},
"dataset": {"_component_": "custom_dataset"},
"output_dir": "/tmp/finetune_results"
}