forked from metavoiceio/metavoice-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Containerized servings.py (metavoiceio#17)
* Containerized * containerized * containerized 0.1 * assets * Update README.md Signed-off-by: Lucas Hänke de Cansino <lhc@next-boss.eu> * Update serving.py Signed-off-by: Lucas Hänke de Cansino <lhc@next-boss.eu> * Update .gitignore Signed-off-by: Lucas Hänke de Cansino <lhc@next-boss.eu> * Delete assets/GER_F_SylviaF.flac Signed-off-by: Lucas Hänke de Cansino <lhc@next-boss.eu> * Delete assets/barackobamafederalplaza.flac Signed-off-by: Lucas Hänke de Cansino <lhc@next-boss.eu> * requested changes * add flash-attn * update: docker compose with common configs * feat: add health check endpoint * feat: make services naming terse * feat: reduce health check durations * update: README.md --------- Signed-off-by: Lucas Hänke de Cansino <lhc@next-boss.eu> Co-authored-by: l4b4r4b4b4 <l4b4r4b4b4> Co-authored-by: sid <sid@themetavoice.xyz> Co-authored-by: Vatsal Aggarwal <vatsal@themetavoice.xyz>
- Loading branch information
1 parent
394b7fc
commit 33cd288
Showing
6 changed files
with
119 additions
and
4 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.vscode | ||
*.pkl | ||
*.flac | ||
*.npz | ||
|
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,32 @@ | ||
FROM nvidia/cuda:12.1.0-devel-ubuntu22.04 as base | ||
|
||
# Install system dependencies in a single RUN command to reduce layers | ||
# Combine apt-get update, upgrade, and installation of packages. Clean up in the same layer to reduce image size. | ||
RUN apt-get update && \ | ||
apt-get upgrade -y && \ | ||
apt-get install -y python3.10 python3-pip git wget curl build-essential && \ | ||
apt-get autoremove -y && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# install ffmpeg | ||
RUN wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz &&\ | ||
wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz.md5 &&\ | ||
md5sum -c ffmpeg-git-amd64-static.tar.xz.md5 &&\ | ||
tar xvf ffmpeg-git-amd64-static.tar.xz &&\ | ||
mv ffmpeg-git-*-static/ffprobe ffmpeg-git-*-static/ffmpeg /usr/local/bin/ &&\ | ||
rm -rf ffmpeg-git-* | ||
|
||
WORKDIR /app | ||
|
||
COPY requirements.txt requirements.txt | ||
|
||
RUN pip install --no-cache-dir packaging wheel torch | ||
RUN pip install --no-cache-dir flash-attn | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
COPY . . | ||
|
||
RUN pip install --no-cache-dir -e . | ||
|
||
ENTRYPOINT ["python3.10", "fam/llm/serving.py"] |
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
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,61 @@ | ||
version: "3.5" | ||
|
||
networks: | ||
metavoice-net: | ||
driver: bridge | ||
|
||
volumes: | ||
hf-cache: | ||
driver: local | ||
|
||
x-common-settings: &common-settings | ||
volumes: | ||
- hf-cache:/.hf-cache | ||
- ./assets:/app/assets | ||
deploy: | ||
replicas: 1 | ||
resources: | ||
reservations: | ||
devices: | ||
- driver: nvidia | ||
count: 1 | ||
capabilities: [ gpu ] | ||
runtime: nvidia | ||
ipc: host | ||
tty: true # enable colorized logs | ||
build: | ||
context: . | ||
image: metavoice-server:latest | ||
networks: | ||
- metavoice-net | ||
environment: | ||
- NVIDIA_VISIBLE_DEVICES=all | ||
- HF_HOME=/.hf-cache | ||
logging: | ||
options: | ||
max-size: "100m" | ||
max-file: "10" | ||
|
||
services: | ||
server: | ||
<<: *common-settings | ||
container_name: metavoice-server | ||
command: [ "--port=58004" ] | ||
ports: | ||
- 58004:58004 | ||
healthcheck: | ||
test: [ "CMD", "curl", "http://metavoice-server:58004/health" ] | ||
interval: 1m | ||
timeout: 10s | ||
retries: 20 | ||
ui: | ||
<<: *common-settings | ||
container_name: metavoice-ui | ||
entrypoint: [ "python3.10", "app.py" ] | ||
ports: | ||
- 7861:7861 | ||
healthcheck: | ||
test: [ "CMD", "curl", "http://localhost:7861" ] | ||
interval: 1m | ||
timeout: 10s | ||
retries: 1 |
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