From 48de374f20f8a265213474eeb7a3cee7c8899c13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Reil=C3=A4nder?= Date: Sun, 12 Nov 2023 14:31:38 +0100 Subject: [PATCH] enable GPU support --- wyoming_piper/__main__.py | 5 +++++ wyoming_piper/process.py | 3 +++ 2 files changed, 8 insertions(+) diff --git a/wyoming_piper/__main__.py b/wyoming_piper/__main__.py index e256f89..ea81455 100755 --- a/wyoming_piper/__main__.py +++ b/wyoming_piper/__main__.py @@ -65,6 +65,11 @@ async def main() -> None: action="store_true", help="Download latest voices.json during startup", ) + parser.add_argument( + "--cuda", + action="store_true", + help="Use GPU" + ) # parser.add_argument("--debug", action="store_true", help="Log DEBUG messages") args = parser.parse_args() diff --git a/wyoming_piper/process.py b/wyoming_piper/process.py index a7e90a7..8c136be 100644 --- a/wyoming_piper/process.py +++ b/wyoming_piper/process.py @@ -148,6 +148,9 @@ async def get_process(self, voice_name: Optional[str] = None) -> PiperProcess: if self.args.noise_w: piper_args.extend(["--noise-w", str(self.args.noise_w)]) + if self.args.cuda: + piper_args.extend(["--cuda"]) + _LOGGER.debug( "Starting piper process: %s args=%s", self.args.piper, piper_args )