728x90

Llama2 환경설정

가상환경 설치 패키지 및 버전

python 3.11
torch 2.1.2
cuda 12.1
openpyxl
pandas
jupyter notebook

환경설정 AtoZ

제 환경은 window 10, rtx 4090(nvidia)

그냥 따라 치면 된다

가상환경 생성

conda create -n [가상환경이름] python=3.11
conda activate [가상환경이름]

torch 설치🔥Window + Nvidia 조합)🔥

pip3 install torch==2.1.* torchvision==0.16.* torchaudio==2.1.* --index-url https://download.pytorch.org/whl/cu121
  • Window가 아니거나 그래픽카드가 Nvidia가 아니면 참고
| System | GPU | Command |
| --- | --- | --- |
| Linux/WSL | NVIDIA | pip3 install torch==2.1.* torchvision==0.16.* torchaudio==2.1.* --index-url https://download.pytorch.org/whl/cu121 |
| Linux/WSL | CPU only | pip3 install torch==2.1.* torchvision==0.16.* torchaudio==2.1.* --index-url https://download.pytorch.org/whl/cpu |
| Linux | AMD | pip3 install torch==2.1.* torchvision==0.16.* torchaudio==2.1.* --index-url https://download.pytorch.org/whl/rocm5.6 |
| MacOS + MPS | Any | pip3 install torch==2.1.* torchvision==0.16.* torchaudio==2.1.* |
| Windows | NVIDIA | pip3 install torch==2.1.* torchvision==0.16.* torchaudio==2.1.* --index-url https://download.pytorch.org/whl/cu121 |
| Windows | CPU only | pip3 install torch==2.1.* torchvision==0.16.* torchaudio==2.1.* |

requirements.txt에서 dependency 설치

requirements.txt

위 파일을 current directory에 다운로드 받은 후 아래 명령어 실행

pip install -r requirements.txt

나머지 패키지 설치

아래 두 패키지는 필수 아님. 편의를 위해 설치함.

  • pandas : tabular data(테이블 형식 데이터) 처리를 위해 사용하는 패키지
  • jupyter notebook : 구글 colab처럼 셀별로 실행 및 결과확인이 가능해서 사용하는 editor.
    코드 단위별로 디버깅이 용이함.
pip install -y pandas jupyter notebook openpyxl

위 코드 오류나면 pandas랑 jupyter notebook 따로 설치하기

'인공지능 > LLM' 카테고리의 다른 글

챗봇 구현 실습 (1) - OpenAI API  (0) 2024.03.17
OpenAI API 설명 (GPT)  (0) 2024.03.17
LLAMA2 (3) 답변 받기  (1) 2024.03.15
LLAMA2 (1) 설치  (2) 2024.03.15
TextGen WebUI  (0) 2024.03.15

+ Recent posts