การบันทึก recipe แบบกำหนดเอง
ลูกค้าได้ขอปรับเปลี่ยนข้อกำหนดเพิ่มเติม คราวนี้ต้องการเพิ่มจำนวนพารามิเตอร์และใช้โมเดล Llama 3.2 ที่มี 3B พารามิเตอร์ ให้แก้ไข dictionary ตามนั้น แล้วบันทึกเป็นไฟล์ YAML
ไลบรารี yaml ถูก import ไว้ล่วงหน้าแล้ว
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
Fine-Tuning กับ Llama 3
คำแนะนำการฝึกหัด
- ระบุข้อกำหนดโมเดลใหม่คือ
torchtune.models.llama3_2.llama3_2_3bลงใน dictionary - บันทึกข้อกำหนดเป็นไฟล์ YAML ชื่อ
custom_recipe.yaml
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
config_dict = {
# Update the model
____,
"batch_size": 8,
"device": "cuda",
"optimizer": {"_component_": "bitsandbytes.optim.PagedAdamW8bit", "lr": 3e-05},
"dataset": {"_component_": "custom_dataset"},
"output_dir": "/tmp/finetune_results"
}
# Save the updated configuration to a new YAML file
with open("custom_recipe.yaml", "w") as yaml_file:
____