Skip to content
Snippets Groups Projects
Unverified Commit 8096f91d authored by joecryptotoo's avatar joecryptotoo Committed by GitHub
Browse files

Dockerize (#22)

* created Dockerfile and docker-compose.yml

* Update docker-compose.yml

* added docker instructions to readme
parent ec3c225a
Branches
No related tags found
No related merge requests found
tmp
cache
Dockerfile
docker-compose.yml
.dockerignore
.gitignore
__pycache__
tmp
\ No newline at end of file
tmp
cache
\ No newline at end of file
FROM pytorch/pytorch:2.4.0-cuda12.1-cudnn9-devel
ENV PYTHONUNBUFFERED 1
WORKDIR /usr/src/app
# Install packages
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
......@@ -12,6 +12,7 @@
- [Modularity](#modularity)
* [Setup](#setup)
* [Usage](#usage)
- [Docker Server approach](#docker-server)
- [Server/Client approach](#serverclient-approach)
- [Local approach](#local-approach)
* [Command-line usage](#command-line-usage)
......@@ -56,6 +57,15 @@ The pipeline can be run in two ways:
- **Server/Client approach**: Models run on a server, and audio input/output are streamed from a client.
- **Local approach**: Uses the same client/server method but with the loopback address.
### Docker Server
#### Install the NVIDIA Container Toolkit
https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html
#### Start the docker container
```docker compose up```
### Server/Client Approach
To run the pipeline on the server:
......
---
version: "3.8"
services:
pipeline:
build:
context: .
command:
- python3
- s2s_pipeline.py
- --recv_host
- 0.0.0.0
- --send_host
- 0.0.0.0
- --lm_model_name
- microsoft/Phi-3-mini-4k-instruct
- --init_chat_role
- system
- --init_chat_prompt
- "You are a helpful assistant"
- --stt_compile_mode
- reduce-overhead
- --tts_compile_mode
- default
expose:
- 12345/tcp
- 12346/tcp
ports:
- 12345:12345/tcp
- 12346:12346/tcp
volumes:
- ./cache/:/root/.cache/
- ./s2s_pipeline.py:/usr/src/app/s2s_pipeline.py
deploy:
resources:
reservations:
devices:
- driver: nvidia
device_ids: ['0']
capabilities: [gpu]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment