forked from turboderp/exllama
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull upstream changes, fix conflict, bump version to 0.0.3
- Loading branch information
Showing
36 changed files
with
730 additions
and
842 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
exllama_sessions | ||
models |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
PORT=5000 | ||
MODEL_PATH=models/LLaMA-7B-4bit-128g # replace with the actual model path on the host | ||
CONTAINER_MODEL_PATH=/app/model | ||
SESSIONS_PATH=./exllama_sessions |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04 as build | ||
|
||
ENV RUN_UID=1000 | ||
|
||
RUN apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y ninja-build python3 python3-pip && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Setup user which will run the service | ||
RUN useradd -m -u $RUN_UID user | ||
USER user | ||
|
||
COPY --chown=user . /app | ||
|
||
WORKDIR /app | ||
|
||
RUN pip install --upgrade pip setuptools wheel \ | ||
&& pip install -r requirements.txt \ | ||
&& pip install flask==2.3.2 | ||
|
||
USER root | ||
|
||
STOPSIGNAL SIGINT | ||
ENTRYPOINT ["/bin/bash", "-c", "/app/entrypoint.sh $0 $@"] |
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
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
File renamed without changes
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
version: "3.9" | ||
name: exllama | ||
services: | ||
web: | ||
build: | ||
context: . | ||
command: | | ||
--host 0.0.0.0:$PORT | ||
env_file: | ||
- .env | ||
environment: | ||
- CONTAINER_MODEL_PATH=$CONTAINER_MODEL_PATH | ||
volumes: | ||
- $MODEL_PATH:$CONTAINER_MODEL_PATH | ||
- $SESSIONS_PATH:/home/user/exllama_sessions | ||
ports: | ||
- "$PORT:$PORT" | ||
tmpfs: | ||
- /tmp | ||
stdin_open: true | ||
tty: true | ||
deploy: | ||
resources: | ||
reservations: | ||
devices: | ||
- driver: nvidia | ||
count: all | ||
capabilities: [gpu] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
set -Eeuo pipefail | ||
|
||
# Ensure that the model path is set | ||
if [ -z $CONTAINER_MODEL_PATH ]; then | ||
echo "Must specify model path" | ||
exit 1 | ||
fi | ||
|
||
# Ensure that bind-mounted directories are owned by the user that runs the service | ||
chown -R $RUN_UID:$RUN_UID $CONTAINER_MODEL_PATH | ||
chown -R $RUN_UID:$RUN_UID /home/user/exllama_sessions | ||
|
||
# Run service as specified (non-root) user | ||
exec runuser -u $(id -un $RUN_UID) -- python3 /app/webui/app.py -d $CONTAINER_MODEL_PATH $@ |
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
Oops, something went wrong.