topic. Google GPU를 사용하기 위해 Colab사용방법을 알아봅니다.
1. 톱니바퀴 클릭
2. 다음과 같이 설정
3. 명령어 순서대로 입력
사양 확인
!nvidia-smi
현재 디렉토리 확인
import os
print(os.getcwd())
!ls
구글 드라이브 마운트
from google.colab import drive
drive.mount('./MyDrive')
마운트된 드라이브로 이동
cd MyDrive/MyDrive
cd Colab\ Notebooks
requirments.txt 파일 작성
----requirments.txt
datasets
loralib
sentencepiece
git+https://github.com/huggingface/transformers.git
accelerate
bitsandbytes
git+https://github.com/huggingface/peft.git
gradio
라이브러리 설치
pip install -r requirements.txt
pip uninstall peft -y -q
pip install -q git+https://github.com/huggingface/peft.git@e536616888d51b453ed354a6f1e243fecb02ea08
pip install wandb
파이썬파일 실행
%run ./finetune.py \
--data_path="./mall_json_data/json_qna_data.json" \
--micro_batch_size=8 \
--batch_size=128 \
--lr=3e-4 \
--epochs=3 \
--output_dir="./lora-alpaca" \
--model_pretrained_name="decapoda-research/llama-7b-hf"
'A.I.(인공지능) & M.L.(머신러닝) > Development Environments' 카테고리의 다른 글
[설치] Ubuntu20.04 pytorch2.0 cuda117 setup (0) | 2023.08.30 |
---|---|
[실습] A.I. Pre-trained Model Fine-tuning 을 위한 환경설정(Linux Ubuntu) (0) | 2023.06.24 |