Skip to content

Commit 1b94691

Browse files
authored
Merge branch 'master' into fix-json-api-keys-ff1
2 parents add7fb3 + 2b2d667 commit 1b94691

File tree

13 files changed

+683
-11
lines changed

13 files changed

+683
-11
lines changed

Dockerfile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ARG TARGETARCH
1212
ARG TARGETVARIANT
1313

1414
ENV BUILD_TYPE=${BUILD_TYPE}
15-
ENV EXTERNAL_GRPC_BACKENDS="huggingface-embeddings:/build/backend/python/sentencetransformers/run.sh,petals:/build/backend/python/petals/run.sh,transformers:/build/backend/python/transformers/run.sh,sentencetransformers:/build/backend/python/sentencetransformers/run.sh,autogptq:/build/backend/python/autogptq/run.sh,bark:/build/backend/python/bark/run.sh,diffusers:/build/backend/python/diffusers/run.sh,exllama:/build/backend/python/exllama/run.sh,vall-e-x:/build/backend/python/vall-e-x/run.sh,vllm:/build/backend/python/vllm/run.sh"
15+
ENV EXTERNAL_GRPC_BACKENDS="huggingface-embeddings:/build/backend/python/sentencetransformers/run.sh,petals:/build/backend/python/petals/run.sh,transformers:/build/backend/python/transformers/run.sh,sentencetransformers:/build/backend/python/sentencetransformers/run.sh,autogptq:/build/backend/python/autogptq/run.sh,bark:/build/backend/python/bark/run.sh,diffusers:/build/backend/python/diffusers/run.sh,exllama:/build/backend/python/exllama/run.sh,vall-e-x:/build/backend/python/vall-e-x/run.sh,vllm:/build/backend/python/vllm/run.sh,exllama2:/build/backend/python/exllama2/run.sh"
1616
ENV GALLERIES='[{"name":"model-gallery", "url":"github:go-skynet/model-gallery/index.yaml"}, {"url": "github:go-skynet/model-gallery/huggingface.yaml","name":"huggingface"}]'
1717
ARG GO_TAGS="stablediffusion tts"
1818

@@ -181,16 +181,13 @@ RUN if [ "${IMAGE_TYPE}" = "extras" ]; then \
181181
RUN if [ "${IMAGE_TYPE}" = "extras" ]; then \
182182
PATH=$PATH:/opt/conda/bin make -C backend/python/exllama \
183183
; fi
184+
RUN if [ "${IMAGE_TYPE}" = "extras" ]; then \
185+
PATH=$PATH:/opt/conda/bin make -C backend/python/exllama2 \
186+
; fi
184187
RUN if [ "${IMAGE_TYPE}" = "extras" ]; then \
185188
PATH=$PATH:/opt/conda/bin make -C backend/python/petals \
186189
; fi
187190

188-
# we also copy exllama libs over to resolve exllama import error
189-
# TODO: check if this is still needed
190-
RUN if [ -d /usr/local/lib/python3.9/dist-packages/exllama ]; then \
191-
cp -rfv /usr/local/lib/python3.9/dist-packages/exllama backend/python/exllama/;\
192-
fi
193-
194191
# Define the health check command
195192
HEALTHCHECK --interval=1m --timeout=10m --retries=10 \
196193
CMD curl -f $HEALTHCHECK_ENDPOINT || exit 1

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ protogen-python:
396396
python3 -m grpc_tools.protoc -Ibackend/ --python_out=backend/python/vall-e-x/ --grpc_python_out=backend/python/vall-e-x/ backend/backend.proto
397397
python3 -m grpc_tools.protoc -Ibackend/ --python_out=backend/python/vllm/ --grpc_python_out=backend/python/vllm/ backend/backend.proto
398398
python3 -m grpc_tools.protoc -Ibackend/ --python_out=backend/python/petals/ --grpc_python_out=backend/python/petals/ backend/backend.proto
399+
python3 -m grpc_tools.protoc -Ibackend/ --python_out=backend/python/exllama2/ --grpc_python_out=backend/python/exllama2/ backend/backend.proto
399400

400401
## GRPC
401402
# Note: it is duplicated in the Dockerfile
@@ -409,6 +410,7 @@ prepare-extra-conda-environments:
409410
$(MAKE) -C backend/python/vall-e-x
410411
$(MAKE) -C backend/python/exllama
411412
$(MAKE) -C backend/python/petals
413+
$(MAKE) -C backend/python/exllama2
412414

413415

414416
backend-assets/grpc:

backend/python/exllama/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ exllama:
33
@echo "Creating virtual environment..."
44
@conda env create --name exllama --file exllama.yml
55
@echo "Virtual environment created."
6+
bash install.sh
67

78
.PHONY: run
89
run:

backend/python/exllama/exllama.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313
import torch
1414
import torch.nn.functional as F
1515
from torch import version as torch_version
16-
from exllama.generator import ExLlamaGenerator
17-
from exllama.model import ExLlama, ExLlamaCache, ExLlamaConfig
18-
from exllama.tokenizer import ExLlamaTokenizer
16+
17+
from tokenizer import ExLlamaTokenizer
18+
from generator import ExLlamaGenerator
19+
from model import ExLlama, ExLlamaCache, ExLlamaConfig
1920

2021
_ONE_DAY_IN_SECONDS = 60 * 60 * 24
2122

backend/python/exllama/exllama.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ dependencies:
3333
- mpmath==1.3.0
3434
- networkx==3.1
3535
- ninja==1.11.1
36+
- protobuf==4.24.4
3637
- nvidia-cublas-cu12==12.1.3.1
3738
- nvidia-cuda-cupti-cu12==12.1.105
3839
- nvidia-cuda-nvrtc-cu12==12.1.105
@@ -45,11 +46,11 @@ dependencies:
4546
- nvidia-nccl-cu12==2.18.1
4647
- nvidia-nvjitlink-cu12==12.2.140
4748
- nvidia-nvtx-cu12==12.1.105
48-
- protobuf==4.24.4
4949
- safetensors==0.3.2
5050
- sentencepiece==0.1.99
5151
- sympy==1.12
5252
- torch==2.1.0
5353
- triton==2.1.0
5454
- typing-extensions==4.8.0
55+
- numpy
5556
prefix: /opt/conda/envs/exllama

backend/python/exllama/install.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
##
4+
## A bash script installs the required dependencies of VALL-E-X and prepares the environment
5+
export PATH=$PATH:/opt/conda/bin
6+
7+
# Activate conda environment
8+
source activate exllama
9+
10+
echo $CONDA_PREFIX
11+
12+
13+
git clone https://github.com/turboderp/exllama $CONDA_PREFIX/exllama && pushd $CONDA_PREFIX/exllama && pip install -r requirements.txt && popd
14+
15+
cp -rfv $CONDA_PREFIX/exllama/* ./

backend/python/exllama2/Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.PHONY: exllama2
2+
exllama2:
3+
@echo "Creating virtual environment..."
4+
@conda env create --name exllama2 --file exllama2.yml
5+
@echo "Virtual environment created."
6+
bash install.sh
7+
8+
.PHONY: run
9+
run:
10+
@echo "Running exllama2..."
11+
bash run.sh
12+
@echo "exllama2 run."

backend/python/exllama2/backend_pb2.py

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)