728x90
반응형
설치개요
Text Generation web UI 와 Hugging Face의 Open AI 모델을 다운받아 로컬에서 chat 테스해보기

- Text Generation Web UI Git
    https://github.com/oobabooga/text-generation-webui

- PC : Windows 11 / NVIDIA GeForce RTX 4060 Laptop GPU
- PC에 Git이 설치되어 있어야 한다.

- PC에 anaconda가 pc에 미리 설치되어 있어야 한다. https://www.anaconda.com/

 

  • HuggingFace Llma korea 모델 사용해 보기

https://huggingface.co/beomi/Llama-3-Open-Ko-8B

 

beomi/Llama-3-Open-Ko-8B · Hugging Face

Update @ 2024.05.01: Pre-Release Llama-3-KoEn-8B model & Llama-3-KoEn-8B-Instruct-preview Update @ 2024.04.24: Release Llama-3-Open-Ko-8B model & Llama-3-Open-Ko-8B-Instruct-preview Model Details Llama-3-Open-Ko-8B Llama-3-Open-Ko-8B model is continued pre

huggingface.co

 

  • HuggingFace 한국어 리더 보드 (Open Ko-LLM Leaderboard) / web page 로딩하는데 시간이 많이 걸

https://huggingface.co/spaces/upstage/open-ko-llm-leaderboard

 

Open Ko-LLM Leaderboard - a Hugging Face Space by upstage

 

huggingface.co

 

 

 

pc에 설치 진행과정
#내 pc의 conda 경로는 

# 기본 conda 경로
C:\Users\shim\anaconda3

# 가상환경에 생성되는 경로

C:\Users\shim\anaconda3\envs

# Text Generation Web UI 테스트할 경로
C:\Users\shim\anaconda3\envs\textgenwebui

 

가상환경 설치 및 text-generation-webui Git 다운로드 및 설치  
# 가상환경을 생성한다 . python version는 3.10으로 함 (일부 3.11 이후 버젼은 cuda인식불가로)
# (base) C:\Users\shim>conda create -n textgenwebui python=3.10
Channels:
 - defaults
Platform: win-64
Collecting package metadata (repodata.json): done
Solving environment: done
<< Package Plan >>
  environment location: C:\Users\shim\anaconda3\envs\textgenwebui
  added / updated specs:
    - python=3.10
The following NEW packages will be INSTALLED:
  bzip2              pkgs/main/win-64::bzip2-1.0.8-h2bbff1b_6
  ca-certificates    pkgs/main/win-64::ca-certificates-2024.3.11-haa95532_0
  libffi             pkgs/main/win-64::libffi-3.4.4-hd77b12b_1
  openssl            pkgs/main/win-64::openssl-3.0.13-h2bbff1b_1
  pip                pkgs/main/win-64::pip-24.0-py310haa95532_0
  python             pkgs/main/win-64::python-3.10.14-he1021f5_1
  setuptools         pkgs/main/win-64::setuptools-69.5.1-py310haa95532_0
  sqlite             pkgs/main/win-64::sqlite-3.45.3-h2bbff1b_0
  tk                 pkgs/main/win-64::tk-8.6.14-h0416ee5_0
  tzdata             pkgs/main/noarch::tzdata-2024a-h04d1e81_0
  vc                 pkgs/main/win-64::vc-14.2-h21ff451_1
  vs2015_runtime     pkgs/main/win-64::vs2015_runtime-14.27.29016-h5e58377_2
  wheel              pkgs/main/win-64::wheel-0.43.0-py310haa95532_0
  xz                 pkgs/main/win-64::xz-5.4.6-h8cc25b3_1
  zlib               pkgs/main/win-64::zlib-1.2.13-h8cc25b3_1

# Proceed ([y]/n)? y

Downloading and Extracting Packages:
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

 To activate this environment, use

     $ conda activate textgenwebui

 To deactivate an active environment, use

     $ conda deactivate

# 가상환경 activate 시킴
# (base) C:\Users\shim>conda activate textgenwebui

# 가상환경 확인 
# (textgenwebui) C:\Users\shim>conda env list
 conda environments:

base                     C:\Users\shim\anaconda3
cuda                     C:\Users\shim\anaconda3\envs\cuda
llm                      C:\Users\shim\anaconda3\envs\llm
textgen                  C:\Users\shim\anaconda3\envs\textgen
                         C:\Users\shim\anaconda3\envs\textgen\text-generation-webui\installer_files\conda
                         C:\Users\shim\anaconda3\envs\textgen\text-generation-webui\installer_files\env
textgenwebui          *  C:\Users\shim\anaconda3\envs\textgenwebui

# 가상환경 경로로 이동
# (textgenwebui) C:\Users\shim>cd anaconda3
# (textgenwebui) C:\Users\shim\anaconda3>cd envs
# (textgenwebui) C:\Users\shim\anaconda3\envs>cd textgenwebui

# text-generation-webui git 다운로드 함
# (textgenwebui) C:\Users\shim\anaconda3\envs\textgenwebui>git clone https://github.com/oobabooga/text-generation-webui.git
Cloning into 'text-generation-webui'...
remote: Enumerating objects: 17986, done.
remote: Counting objects: 100% (28/28), done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 17986 (delta 21), reused 11 (delta 8), pack-reused 17958
Receiving objects: 100% (17986/17986), 27.52 MiB | 6.06 MiB/s, done.
Resolving deltas: 100% (12710/12710), done.

# 해당 디렉토리로 이동 
# (textgenwebui) C:\Users\shim\anaconda3\envs\textgenwebui>cd text-generation-webui

# text-generation-webui 설치파일 실행
# 설치는 windows이므로 start_windows.bat를 실행함
# (textgenwebui) C:\Users\shim\anaconda3\envs\textgenwebui\text-generation-webui>start_windows.bat

 

GPU 사용을 위해서 conda, cudnn, Tensorflow 설치한다.
# (textgenwebui) C:\Users\shim>conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0
# (textgenwebui) C:\Users\shim>python -m pip install "tensorflow<2.11"

 

설치 및 완료 및 로그파일 

 

text-generation-webui설치로그(20240515).txt
0.07MB

# (textgenwebui) C:\Users\shim\anaconda3\envs\textgenwebui\text-generation-webui>start_windows.bat
Downloading Miniconda from https://repo.anaconda.com/miniconda/Miniconda3-py310_23.3.1-0-Windows-x86_64.exe to C:\Users\shim\anaconda3\envs\textgenwebui\text-generation-webui\installer_files\miniconda_installer.exe
하위 디렉터리 또는 파일 C:\Users\shim\anaconda3\envs\textgenwebui\text-generation-webui\installer_files이(가) 이미 있습니다.
   Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 53.8M  100 53.8M    0     0  10.0M      0  0:00:05  0:00:05 --:--:-- 10.1M

What is your GPU?

A) NVIDIA
B) AMD (Linux/MacOS only. Requires ROCm SDK 5.6 on Linux)
C) Apple M Series
D) Intel Arc (IPEX)
N) None (I want to run models in CPU mode)

#Input> A

Do you want to use CUDA 11.8 instead of 12.1?
Only choose this option if your GPU is very old (Kepler or older).

For RTX and GTX series GPUs, say "N".
If unsure, say "N".

Input (Y/N)> N
CUDA: 12.1

...
설치 로그 생략 (첨부파일 참조)
...

There are no logfile(s) to remove.
Files removed: 976


*******************************************************************
* You haven't downloaded any model yet.
* Once the web UI launches, head over to the "Model" tab and download one.
*******************************************************************

16:30:07-495825 INFO     Starting Text generation web UI

Running on local URL:  http://127.0.0.1:7860

 

설치가 완료되면 다음과 같이 URL 주소가 생기며 웹을 접속하면 됨
Running on local URL:  http://127.0.0.1:7860

 

  • 웹접속 화면

 

HuggingFace AI 모델 다운로드 해보기
 

beomi/Llama-3-Open-Ko-8B · Hugging Face

Update @ 2024.05.01: Pre-Release Llama-3-KoEn-8B model & Llama-3-KoEn-8B-Instruct-preview Update @ 2024.04.24: Release Llama-3-Open-Ko-8B model & Llama-3-Open-Ko-8B-Instruct-preview Model Details Llama-3-Open-Ko-8B Llama-3-Open-Ko-8B model is continued pre

huggingface.co

  • 웹 다운로드 주소에 아래 레포티토리 모델을 선택하고 다운로드를 클릭함
  • 또는 cmd창에서 # python download-model.py beomi/Llama-3-Open-Ko-8B 
  • beomi/Llama-3-Open-Ko-8B 

 

  • 다운로드 시간이 많이 걸림

 

 

 

 

한국어 모델 다운로드 및 테스트

 

 

728x90
반응형
LIST

+ Recent posts