Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Download an LLM for use with text-generation-webui on Ubuntu | |
pushd text-generation-webui | |
echo "=== === Downloading an LLM ..." | |
# python3 download-model.py TheBloke/CodeLlama-13B-GGUF | |
python3 download-model.py mistralai/Mistral-7B-v0.1 | |
echo "=== === [done]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Basic NON interactive install of text-generation-webui to host LLM on Ubuntu | |
GPU_GB=${1:-24} | |
#sudo apt update | |
#sudo apt install python3-pip | |
git clone https://github.com/oobabooga/text-generation-webui.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: 2010-09-09 | |
Resources: | |
LlmEc2KeyPair: | |
Type: AWS::EC2::KeyPair | |
Properties: | |
KeyName: !Join [ "-", [ "llmkeys", !Ref "AWS::StackName" ] ] | |
LlmSshSecurityGroup: | |
Type: AWS::EC2::SecurityGroup | |
Properties: | |
GroupName: !Join [ "-", [ "llmsshsg", !Ref "AWS::StackName"]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws ec2 describe-instance-types --instance-types g4dn.xlarge g5.xlarge --query "InstanceTypes[].GpuInfo" --no-cli-pager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# so future errors halt the script. | |
set -e | |
echo Linting ... | |
# Disable less useful errors | |
# - ref https://www.flake8rules.com/ | |
# | |
# E302 Expected 2 blank lines | |
# E305 Expected 2 blank lines after end of function or class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
GPU_GB=${1:-24} | |
pushd /home/ubuntu/text-generation-webui | |
GPU_CHOICE=A USE_CUDA118=FALSE LAUNCH_AFTER_INSTALL=TRUE INSTALL_EXTENSIONS=TRUE ./start_linux.sh --public-api --extensions openai --api-port 5000 --auto-devices --gpu-memory $GPU_GB | |
# --share |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
GPU_GB=${1:-24} | |
OUT_FILE=/etc/systemd/system/llmtextgen.service | |
if [ -e $OUT_FILE ] | |
then | |
echo LLM servic 'llmtextgen.service' already installed - exiting. | |
exit 0; | |
fi | |
echo Downloading script to /home/ubuntu/start-llm.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/etc/systemd/system/llmtextgen.service | |
[Unit] | |
After=network.target | |
[Service] | |
Type=simple | |
ExecStart=/bin/bash /home/ubuntu/start-llm.sh | |
User=ubuntu | |
Group=ubuntu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt update | |
sudo apt install python3-pip | |
conda create -n textgen python=3.10.9 | |
conda activate textgen | |
conda init bash | |
pip install torch torchvision torchaudio | |
git clone https://github.com/oobabooga/text-generation-webui | |
cd text-generation-webui | |
pip install -r requirements.txt |
NewerOlder