Text Generation Web UI 시작하기

Mingyu Cha
3 min readDec 17, 2023

--

소개

Text Generation Web UI는 LLaMA, GPT-J, OPT 등과 같은 대규모 언어 모델을 실행하기 위한 Gradio 기반 웹 인터페이스입니다. 이를 통해 다양한 텍스트 생성 모델과 파라미터를 쉽게 선택하여 원하는 텍스트를 만들 수 있습니다.

설치 단계

1단계: 새로운 Conda 환경 만들기

conda create -n textgen python=3.11
conda activate textgen

2단계: 소스 코드 다운로드

git clone https://github.com/oobabooga/text-generation-webui.git
cd text-generation-webui

3단계: 설치 및 실행

아래는 각 windows, macOS, linux에서의 설치 및 실행 방법이다.

start_windows.bat
./start_macos.sh
./start_linux.sh

4단계: webui 실행

아래와 같은 메세지에서 http://127.0.0.1:7860를 ctrl+click으로 실행한다.

text-generation-webui$ ./start_linux.sh 
2023-12-17 16:19:31 INFO:Loading the extension "gallery"...
Running on local URL: http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
python download-model.py facebook/opt-1.3b

5단계: 모델 다운로드

https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard에 들어가서 원하는 모델을 클릭하고 아래의 그림과 같이 모델 ID를 복사

Model탭으로 들어가서 Download model or LoRA섹션에서 위에서 복사한 내용을 붙여넣고 Download버튼을 누른다.

Download받은 모델을 선택한 뒤 Load를 누른다.

이제 Chat섹션으로 가서 채팅을 시작하면 된다.

--

--