Skip to content

Commit

Permalink
Merge pull request #1 from slackr31337/dev
Browse files Browse the repository at this point in the history
First push from dev
  • Loading branch information
slackr31337 authored Dec 8, 2023
2 parents 6315a16 + 54c96aa commit 4337523
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Docker Image CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build . --file Dockerfile --tag wyoming-piper-gpu:$(date +%s)
41 changes: 41 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM nvidia/cuda:11.7.1-base-ubuntu22.04

# Install Piper
WORKDIR /usr/src

ARG TARGETARCH=amd64
ARG TARGETVARIANT=
ARG PIPER_LIB_VERSION=1.4.0
ARG PIPER_RELEASE=v1.2.0

RUN \
apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
python3 \
python3-pip \
\
&& pip3 install --no-cache-dir -U \
setuptools \
wheel \
\
&& pip3 install --no-cache-dir torch \
\
&& pip3 install --no-cache-dir \
onnxruntime-gpu \
\
&& pip3 install --no-cache-dir \
"wyoming-piper==${PIPER_LIB_VERSION}" \
\
&& curl -L -s \
"https://github.com/rhasspy/piper/releases/download/${PIPER_RELEASE}/piper_${TARGETARCH}${TARGETVARIANT}.tar.gz"|tar -zxvf - -C /usr/share \
\
&& rm -rf /var/lib/apt/lists/* # buildkit


WORKDIR /
COPY run.sh ./

EXPOSE 10200

ENTRYPOINT ["bash", "/run.sh"]
3 changes: 3 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

docker build --network=host --tag=wyoming-piper-gpu .
21 changes: 21 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/python3.10/dist-packages/nvidia/cudnn/lib/
# python3 -m wyoming_piper \
# --piper '/usr/share/piper/piper' \
# --uri 'tcp://0.0.0.0:10200' \
# --length-scale "$(bashio::config 'length_scale')" \
# --noise-scale "$(bashio::config 'noise_scale')" \
# --noise-w "$(bashio::config 'noise_w')" \
# --speaker "$(bashio::config 'speaker')" \
# --voice "$(bashio::config 'voice')" \
# --max-piper-procs "$(bashio::config 'max_piper_procs')" \
# --data-dir /data \
# --data-dir /share/piper \
# --download-dir /data "$@"
python3 -m wyoming_piper \
--piper '/usr/share/piper/piper' \
--uri 'tcp://0.0.0.0:10200' \
--data-dir /data \
--data-dir /share/piper \
--download-dir /data "$@"

0 comments on commit 4337523

Please sign in to comment.