Skip to content

Instantly share code, notes, and snippets.

@tapir
Last active April 16, 2023 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tapir/1af7d9cf16219e2b733adbbf6b301c72 to your computer and use it in GitHub Desktop.
Save tapir/1af7d9cf16219e2b733adbbf6b301c72 to your computer and use it in GitHub Desktop.
Fast setup of oobabooga for Ubuntu + CUDA
# don't run as root
# install conda
curl https://repo.anaconda.com/pkgs/misc/gpgkeys/anaconda.asc | gpg --dearmor > conda.gpg
install -o root -g root -m 644 conda.gpg /usr/share/keyrings/conda-archive-keyring.gpg
sudo gpg --keyring /usr/share/keyrings/conda-archive-keyring.gpg --no-default-keyring --fingerprint 34161F5BF5EB1D4BFBBB8F0A8AEB4F8B29D82806
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" | sudo tee -a /etc/apt/sources.list.d/conda.list
sudo apt update
apt install conda
# setup conda environment
echo "source /opt/conda/etc/profile.d/conda.sh && conda activate textgen" >> ~/.bashrc
source /opt/conda/etc/profile.d/conda.sh
conda create -n textgen python=3.10.9
conda activate textgen
# install oobabooga
cd ~/
git clone https://github.com/oobabooga/text-generation-webui
cd text-generation-webui
pip3 install torch torchvision torchaudio
pip3 install -r requirements.txt
# fix bitsandbytes no CUDA issue
pip3 install -i https://test.pypi.org/simple/ bitsandbytes-cuda113
# fix 'llama_inference_offload' module not found issue
cd ~/text-generation-webui
mkdir repositories
cd repositories
git clone https://github.com/qwopqwop200/GPTQ-for-LLaMa -b cuda
# download some well known models
cd ~/text-generation-webui
python download-model.py mayaeary/pygmalion-6b-4bit-128g
python download-model.py anon8231489123/gpt4-x-alpaca-13b-native-4bit-128g
python download-model.py anon8231489123/vicuna-13b-GPTQ-4bit-128g
# run with live link
python server.py --share --chat --wbits 4 --groupsize 128 --model [MODEL_NAME]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment