1. ์ฝ˜๋‹ค๋กœ ์ƒˆ๋กœ์šด ๊ฐ€์ƒํ™˜๊ฒฝ ๋งŒ๋“ค์–ด์ค€๋‹ค
  • conda create -n textgen python=3.10
  • ์ด ํ™˜๊ฒฝ ์•„๋ž˜์— ์„ค์น˜ํ•œ ํ›„ ํ™œ์„ฑํ™”ํ•˜๊ธฐ
  • conda activate textgen

 

  1. ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋“ค์„ ์„ค์น˜ํ•œ๋‹ค
  • conda install cuda pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia/label/cuda-11.7.0

 

  1. ์ด์ œ ๊นƒํ—™์—์„œ ๋ฐ›์•„์˜ค์ž

  • ์œ„์™€ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋œฌ๋‹ค. ํ•œ๋ฒˆ ์žก์•„๋ณด์ž.
  • https://github.com/oobabooga/one-click-installers/issues/30#issuecomment-1518040167
  • ํ•œ์‹œ๊ฐ„์ด ๋„˜๊ฒŒ ๊ณ ์ƒํ•˜๋ฉด ์•Œ์•„๋ณธ ๊ฒฐ๊ณผ C complier๊ฐ€ ์—†์–ด์„œ ๋ฐœ์ƒํ•œ ๋ฌธ์ œ์˜€๋‹ค. ์–ด๋””์—๋„ ์ •๋ฆฌ๋œ ๋ฌธ์„œ๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์—ˆ๋‹ค
  • sudo apt install build-essential
  • ์ด๊ฑธ๋กœ c์ปดํŒŒ์ผ๋Ÿฌ๋ฅผ ๊น”๊ณ  ๋‹ค์‹œ ์‹œ๋„ํ•ด๋ณด์ž
  • pip install -r requirements.txt
  • ์ž˜๋œ๋‹ค.
  • python server.py
  • http://127.0.0.1:7860 ์— ์ ‘์†ํ•˜๋ฉด ์œˆ๋„์šฐ์—์„œ ์ฐฝ์ด ์—ด๋ฆฐ๋‹ค. ์šฐ๋ถ„ํˆฌ์™€ ๋ฆฌ๋ˆ…์Šค๊ฐ€ ์ด๋ ‡๊ฒŒ ์—ฐ๊ฒฐ๋œ๋‹ค๋‹ˆ ์‹ ๋น„๋กœ์šด ๊ธฐ๋ถ„์ด๋‹ค.
  • ์„ฑ๊ณต
  • ์ด์ œ ๋ชจ๋ธ๋“ค์„ ๋ชจ๋‘ ํ…Œ์ŠคํŠธํ•ด๋ณด์ž.
  • ์•ˆ๋œ๋‹ค. ๋ชจ๋ธ์„ ๋กœ๋“œํ•˜๋ฉด ModuleNotFoundError: No module named 'llama_inference_offload' ์ด๋Ÿฐ ์—๋Ÿฌ๊ฐ€ ๋œฌ๋‹ค
  • https://github.com/qwopqwop200/GPTQ-for-LLaMa/issues/161

 

  • ์œ„์™€ ๊ฐ™์€ GPTQ๋ฅผ ๋Œ๋ฆฌ๊ธฐ ์œ„ํ•ด์„œ๋Š” ์ถ”๊ฐ€ ์ž‘์—…์ด ํ•„์š”ํ•˜๋‹ค
  • ์•Œ์•„๋ณด๋‹ˆ ์ด๊ฑด ์•„๋ž˜์— ์œˆ๋„์šฐ ์„ค์น˜ํ• ๋•Œ์™€ ๊ฐ™์€ ์ž‘์—…์ด ํ•„์š”ํ•˜๋‹ค.
  • git clone https://github.com/oobabooga/GPTQ-for-LLaMa.git -b cuda
  • cd GPTQ-for-LLaMa && python setup_cuda.py install

 

  • ๋งˆ์ง€๋ง‰์œผ๋กœ GPTQ-for-LLaMa ํด๋”์•ˆ์˜ ๋ชจ๋“  ํŒŒ์ผ์„ ํ†ต์ฑ„๋กœ ์ž˜๋ผ๋‚ด๊ธฐ ํ•œํ›„
  • text-generation-webui ํด๋” ์•ˆ์œผ๋กœ ์ด๋™ํ•˜๊ณ  
  • ์—ฌ๊ธฐ์— ํ†ต์ฑ„๋กœ ๋ถ™์—ฌ๋„ฃ๊ธฐํ•œ๋‹ค. ๋ฎ์–ด์“ฐ๊ธฐ๋Š” ํ•˜์ง€ ์•Š๋Š”๋‹ค. explore.exe๋ฅผ ์ด์šฉํ•ด ์•ˆ์ „ํ•˜๊ฒŒ ์ด๋™์‹œํ‚ค์ž
  • python server.py --listen --listen-port 8001 --chat --auto-devices
  • ๋ชจ๋ธ๋“ค์„ ๋กœ๋”ฉํ•ด๋ณธ๋‹ค. ์„ธํŒ…๋งŒ ๋งž์œผ๋ฉด GPTQ ๋ชจ๋ธ๋“ค๋„ ๋กœ๋”ฉ์ด ์ž˜๋œ๋‹ค.

 

  1. ์™ธ๋ถ€์—์„œ wsl๋กœ ๋ถ™๊ธฐ์œ„ํ•ด ํฌํŠธ ์—ฐ๊ฒฐํ•˜๊ธฐ
  • ๊ด€๋ฆฌ์ž ํŒŒ์›Œ์‰˜์—์„œ 
  • netsh interface portproxy add v4tov4 listenport=8001 listenaddress=0.0.0.0 connectport=8001 connectaddress=172.28.51.232
  • 0.0.0.0์€ ์™ธ๋ถ€์—์„œ ๋ถ™์„ ์ˆ˜ ์žˆ๊ฒŒ ์—ด์–ด์ค€๋‹ค๋Š” ๋œป์ด๊ณ  8001ํฌํŠธ๋Š” ์™ธ๋ถ€์— ์—ด๋ฆฐ ํฌํŠธ์ด๋‹ค. 172.23.81.58์€ wsl2 ํฌํŠธ์ด๋‹ค
  • ํ•ต์‹ฌ์€ connectaddress ์— ํ˜„์žฌ ์šฐ๋ถ„ํˆฌ์˜ ip๋ฅผ ์ ์–ด์ฃผ๋Š” ๊ฒƒ์ด๋‹ค. ์—ฌ๊ธฐ์— localhost๊ฐ€ ๋“ค์–ด๊ฐ€ ์žˆ์œผ๋‹ˆ ์ ‘์†์ด ๊ณ„์† ์•ˆ๋˜์—ˆ๋˜ ๊ฑฐ๋‹ค.
  • ๋งŒ์•ฝ์— ์œ„ ๋‚ด๋ถ€ ํฌํŠธ๊ฐ€ ๋ฐ”๋€”๋•Œ๋ฅผ ๋Œ€๋น„ํ•ด ์Šค์ผ€์ฅด๋Ÿฌ๋ฅผ ์ด์šฉํ•˜๋Š”๋ฐ ์ด๊ฑด
  • https://velog.io/@popcorn_kim93/WSL2%EC%97%90-ssh-%EC%84%9C%EB%B2%84%EC%99%80-%EC%99%B8%EB%B6%80%EC%97%B0%EA%B2%B0-%ED%99%98%EA%B2%BD-%EA%B5%AC%EC%B6%95
  • ๋ฅผ ๋ณด์ž. ์—ฌ๋Ÿฌ๋ฒˆ ์žฌ๋ถ€ํŒ…ํ•ด๋ดค๋Š”๋ฐ ์•„์ง์€ ๋ณ„ ๋ฌธ์ œ๊ฐ€ ์—†๋‹ค

 

  • ๋ฌธ์ œ ๋ฐœ์ƒ์‹œ ์•„๋ž˜๋Š” ํ•ด๋‹น ํฌํŠธ๋ฅผ ์‚ญ์ œํ•˜๊ธฐ
  • netsh interface portproxy delete v4tov4 listenaddress=0.0.0.0 listenport=8001

 

  • wsl์—์„œ ์™ธ๋ถ€๋กœ ์—ด๋ฆฐ ํฌํŠธ ํ™•์ธ. ์•„๋ž˜์˜ ํŒŒ์›Œ์‰˜ ํฌํŠธ์™€ ๋‹ค๋ฅด๋‹ค
  • netsh interface portproxy show v4tov4

 

+ Recent posts