시작하기무료로 시작하기

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

사전 학습된 Llama 모델을 특정 구성으로 미세 조정해 달라는 고객 요청을 받았습니다. TorchTune을 사용해 fine-tuning을 진행할 계획이므로, fine-tuning 작업에 사용할 사용자 정의 레시피의 요구사항을 저장할 Python 딕셔너리를 준비해야 합니다.

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

Llama 3 미세 조정(Fine-Tuning)

강의 보기

연습 안내

  • 딕셔너리에 고객 요구사항을 지정하세요. 먼저 torchtune.models.llama3_2.llama3_2_1b 모델을 추가합니다.
  • batch size를 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"
}
코드 편집 및 실행