Browse Source

fix: docker port and kobold api (#338)

Stefan Daniel Schwarz 1 year ago
parent
commit
b0688b6b9c
4 changed files with 7 additions and 8 deletions
  1. 1 2
      docker/.env
  2. 2 1
      docker/Dockerfile
  3. 1 1
      docker/docker-compose.yml
  4. 3 4
      docker/entrypoint.sh

+ 1 - 2
docker/.env

@@ -5,8 +5,7 @@
 #GID=0
 #TZ=UTC
 
-#PORT=5000
-#HOST=0.0.0.0
+#PORT=7860
 #API_KEY=sk-example
 #SSL_KEYFILE=~/ssl/server.key
 #SSL_CERTFILE=~/ssl/server.crt

+ 2 - 1
docker/Dockerfile

@@ -26,13 +26,14 @@ RUN git clone https://github.com/PygmalionAI/aphrodite-engine.git /tmp/aphrodite
 ENV CUDA_HOME=/usr/local/cuda
 
 ENV HF_HOME=/tmp
+ENV NUMBA_CACHE_DIR=$HF_HOME/numba_cache
 ENV TORCH_CUDA_ARCH_LIST="6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX"
 RUN python3 -m pip install --no-cache-dir -e .
 
 # Entrypoint exec form doesn't do variable substitution automatically ($HOME)
 ENTRYPOINT ["/app/aphrodite-engine/docker/entrypoint.sh"]
 
-EXPOSE 5000
+EXPOSE 7860
 
 USER 1000:0
 

+ 1 - 1
docker/docker-compose.yml

@@ -17,7 +17,7 @@ services:
     image: alpindale/aphrodite-engine
     ipc: host
     ports:
-      - "${PORT:-5000}:5000"
+      - "${PORT:-7860}:7860"
     restart: on-failure:5
     user: "${UID:-1000}:${GID:-0}"
     volumes:

+ 3 - 4
docker/entrypoint.sh

@@ -1,11 +1,10 @@
 #!/bin/bash -e
 
-export NUMBA_CACHE_DIR="/tmp/numba_cache"
 echo 'Starting Aphrodite Engine API server...'
 
 CMD="python3 -m aphrodite.endpoints.openai.api_server
-             --host ${HOST:-0.0.0.0}
-             --port ${PORT:-7860}
+             --host 0.0.0.0
+             --port 7860
              --download-dir ${HF_HOME:?}/hub
              ${MODEL_NAME:+--model $MODEL_NAME}
              ${REVISION:+--revision $REVISION}
@@ -16,7 +15,7 @@ CMD="python3 -m aphrodite.endpoints.openai.api_server
              ${GPU_MEMORY_UTILIZATION:+--gpu-memory-utilization $GPU_MEMORY_UTILIZATION}
              ${QUANTIZATION:+--quantization $QUANTIZATION}
              ${ENFORCE_EAGER:+--enforce-eager}
-             ${KOBOLD:+--launch-kobold-api}
+             ${KOBOLD_API:+--launch-kobold-api}
              ${CMD_ADDITIONAL_ARGUMENTS}"
 
 # set umask to ensure group read / write at runtime