시작하기무료로 시작하기

사용자 정의 레시피 저장하기

고객이 요구 사항 수정을 요청했습니다. 이번에는 파라미터 수를 늘려 3B 파라미터의 Llama 3.2 모델을 사용하고 싶어 합니다. 딕셔너리를 이에 맞게 수정한 뒤, YAML 파일로 저장하세요.

yaml 라이브러리는 이미 임포트되어 있습니다.

이 연습은 강의의 일부입니다

Llama 3 미세 조정(Fine-Tuning)

강의 보기

연습 안내

  • 새 모델 요구 사항인 torchtune.models.llama3_2.llama3_2_3b 모델을 딕셔너리에 지정하세요.
  • 요구 사항을 custom_recipe.yaml이라는 이름의 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:
    ____
코드 편집 및 실행