Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial changes required to get this running on OSX 13.5 / Docker Engine 24.X #113

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ audio
speakers
custom_settings.py
*.zstd
.vscode
.venv
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ WORKDIR /app
ENV TORCH_CUDA_ARCH_LIST="6.0;6.1;6.2;7.0;7.2;7.5;8.0;8.6;8.9;9.0+PTX"

# Install zstd and git-lfs for model compression and distribution
RUN apt-get update && apt-get install -y zstd git-lfs && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y zstd libsndfile1 git-lfs && rm -rf /var/lib/apt/lists/*

# Install our torch ver matching cuda
RUN --mount=type=cache,target=/root/.cache pip install torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 --index-url https://download.pytorch.org/whl/cu118
Expand All @@ -16,7 +16,7 @@ COPY requirements.txt .
RUN --mount=type=cache,target=/root/.cache pip install -r requirements.txt

# Install auto-gptq
RUN --mount=type=cache,target=/root/.cache BUILD_CUDA_EXT=0 pip install auto-gptq[triton]==0.2.2
RUN --mount=type=cache,target=/root/.cache BUILD_CUDA_EXT=0 pip install auto-gptq

COPY . .

Expand Down
3 changes: 2 additions & 1 deletion nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ http {
ssl_prefer_server_ciphers on;
ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
proxy_cache wis;
access_log /dev/stdout combined_ssl;
access_log /tmp/access.log combined_ssl;
error_log /tmp/error.log info;

# Cache TTS requests
location /api/tts {
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ tokenizers==0.13.3
toolz==0.12.0
tqdm==4.65.0
transformers==4.31.0
triton==2.0.0
#triton==2.0.0
types-PyYAML==6.0.12.10
typing_extensions==4.4.0
tzdata==2023.3
Expand Down
14 changes: 10 additions & 4 deletions utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ set -e
WIS_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd "$WIS_DIR"

USE_SUDO=""
SUDO="sudo"
if [ "$USE_SUDO" != 'yes' ];
then SUDO=''
fi

# Test for local environment file and use any overrides
if [ -r .env ]; then
echo "Using configuration overrides from .env file"
Expand Down Expand Up @@ -186,7 +192,7 @@ gen_cert() {
# Remove old wis certs if present
if [ -r cert.pem ] || [ -r key.pem ]; then
echo "Removing old WIS certificate - enter password when prompted"
sudo rm -f key.pem cert.pem
$SUDO rm -f key.pem cert.pem
fi

openssl req -x509 -newkey rsa:2048 -keyout nginx/key.pem -out nginx/cert.pem -sha256 -days 3650 \
Expand Down Expand Up @@ -241,17 +247,17 @@ download_models() {
}

clean_cache() {
sudo rm -rf nginx/cache cache/huggingface
$SUDO rm -rf nginx/cache cache/huggingface
}

clean_models() {
sudo rm -rf models/*
$SUDO rm -rf models/*
}

case $1 in

download-models)
sudo rm -rf models
$SUDO rm -rf models
download_models
;;

Expand Down