From 4a2970c9f0b37d67eacc82acc7604dcf2f01edb2 Mon Sep 17 00:00:00 2001 From: Nick Lange Date: Sat, 12 Aug 2023 11:36:20 -0400 Subject: [PATCH] Initial changes required to get this running on OSX 13.5 / Docker Engine 24.X on OSX against HEAD in the repo. --- .gitignore | 2 ++ Dockerfile | 4 ++-- nginx/nginx.conf | 3 ++- requirements.txt | 2 +- utils.sh | 14 ++++++++++---- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index e30c10a..08a2085 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ audio speakers custom_settings.py *.zstd +.vscode +.venv diff --git a/Dockerfile b/Dockerfile index 862eb15..761e86a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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 . . diff --git a/nginx/nginx.conf b/nginx/nginx.conf index b36ac90..4e5817f 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -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 { diff --git a/requirements.txt b/requirements.txt index a47240a..479ef90 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/utils.sh b/utils.sh index 6362b60..05a566e 100755 --- a/utils.sh +++ b/utils.sh @@ -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" @@ -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 \ @@ -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 ;;