-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
matatonic
committed
May 29, 2024
1 parent
676f3f3
commit 2fcb7ce
Showing
17 changed files
with
188 additions
and
75 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
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,17 +1,22 @@ | ||
FROM python:3.11-slim | ||
|
||
ENV COQUI_TOS_AGREED=1 | ||
|
||
RUN apt-get update && \ | ||
apt-get install --no-install-recommends -y curl git ffmpeg | ||
apt-get install --no-install-recommends -y curl ffmpeg git && \ | ||
apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
RUN mkdir -p /app/voices | ||
WORKDIR /app | ||
COPY *.txt /app/ | ||
RUN mkdir -p voices config | ||
|
||
COPY requirements.txt /app/ | ||
RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements.txt | ||
COPY *.sh *.py *.yaml *.md LICENSE config /app/ | ||
|
||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* | ||
COPY speech.py openedai.py say.py *.sh README.md LICENSE /app/ | ||
COPY config/voice_to_speaker.default.yaml config/pre_process_map.default.yaml /app/config/ | ||
|
||
ARG PRELOAD_MODEL | ||
ENV PRELOAD_MODEL=${PRELOAD_MODEL} | ||
ENV TTS_HOME=voices | ||
ENV HF_HOME=voices | ||
ENV COQUI_TOS_AGREED=1 | ||
|
||
ENV CLI_COMMAND="python speech.py" | ||
CMD $CLI_COMMAND | ||
CMD bash startup.sh |
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,15 +1,19 @@ | ||
FROM python:3.11-slim | ||
|
||
RUN apt-get update && \ | ||
apt-get install --no-install-recommends -y ffmpeg curl | ||
apt-get install --no-install-recommends -y curl ffmpeg && \ | ||
apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
RUN pip install --no-cache piper-tts==1.2.0 pyyaml fastapi uvicorn | ||
|
||
RUN mkdir -p /app/voices | ||
COPY *.py *.yaml *.txt *.md *.sh LICENSE /app/ | ||
WORKDIR /app | ||
RUN mkdir -p voices config | ||
|
||
RUN --mount=type=cache,target=/root/.cache/pip pip install piper-tts==1.2.0 pyyaml fastapi uvicorn | ||
|
||
|
||
COPY speech.py openedai.py say.py *.sh README.md LICENSE /app/ | ||
COPY config/voice_to_speaker.default.yaml config/pre_process_map.default.yaml /app/config/ | ||
|
||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* | ||
ENV TTS_HOME=voices | ||
ENV HF_HOME=voices | ||
|
||
ENV CLI_COMMAND="python speech.py --xtts_device none" | ||
CMD $CLI_COMMAND | ||
CMD bash startup.min.sh |
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,13 @@ | ||
services: | ||
server: | ||
build: | ||
dockerfile: Dockerfile.min # piper for all models, no gpu/nvidia required, ~1GB | ||
image: ghcr.io/matatonic/openedai-speech-min | ||
env_file: speech.env | ||
ports: | ||
- "8000:8000" | ||
volumes: | ||
- ./voices:/app/voices | ||
- ./config:/app/config | ||
# To install as a service | ||
#restart: unless-stopped |
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,6 @@ | ||
@echo off | ||
for %%i in (alloy echo fable onyx nova shimmer) do ( | ||
if not exist "voices\%%i.wav" ( | ||
curl -s https://cdn.openai.com/API/docs/audio/%%i.wav | ffmpeg -loglevel error -i - -ar 22050 -ac 1 voices\%%i.wav | ||
) | ||
) |
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,11 @@ | ||
@echo off | ||
set COQUI_TOS_AGREED=1 | ||
set TTS_HOME=voices | ||
|
||
set MODELS=%* | ||
if "%MODELS%" == "" set MODELS=xtts | ||
|
||
for %%i in (%MODELS%) do ( | ||
python -c "from TTS.utils.manage import ModelManager; ModelManager().download_model('%%i')" | ||
) | ||
call download_samples.bat |
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,8 @@ | ||
@echo off | ||
set models=%* | ||
if "%models%" == "" set models=en_GB-northern_english_male-medium en_US-libritts_r-medium | ||
|
||
piper --update-voices --data-dir voices --download-dir voices --model x 2> nul | ||
for %%i in (%models%) do ( | ||
if not exist "voices\%%i.onnx" piper --data-dir voices --download-dir voices --model %%i > nul | ||
) |
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
Oops, something went wrong.