-
Notifications
You must be signed in to change notification settings - Fork 525
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(wyoming-piper): Enable CUDA, use ESPEAK_NG_DATA_DIR env
- Loading branch information
Showing
3 changed files
with
51 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
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
39 changes: 39 additions & 0 deletions
39
packages/smart-home/wyoming/piper/wyoming-piper_cuda_path.diff
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,39 @@ | ||
diff --git a/wyoming_piper/__main__.py b/wyoming_piper/__main__.py | ||
index 08b20f1..f88312b 100755 | ||
--- a/wyoming_piper/__main__.py | ||
+++ b/wyoming_piper/__main__.py | ||
@@ -77,6 +77,15 @@ async def main() -> None: | ||
version=__version__, | ||
help="Print version and exit", | ||
) | ||
+ parser.add_argument( | ||
+ "--cuda", | ||
+ action="store_true", | ||
+ help="Use GPU" | ||
+ ) | ||
+ parser.add_argument( | ||
+ "--espeak-data-dir", | ||
+ help="Path to espeak-ng data directory" | ||
+ ) | ||
args = parser.parse_args() | ||
|
||
if not args.download_dir: | ||
diff --git a/wyoming_piper/process.py b/wyoming_piper/process.py | ||
index a7e90a7..98b0712 100644 | ||
--- a/wyoming_piper/process.py | ||
+++ b/wyoming_piper/process.py | ||
@@ -148,6 +148,14 @@ class PiperProcessManager: | ||
if self.args.noise_w: | ||
piper_args.extend(["--noise-w", str(self.args.noise_w)]) | ||
|
||
+ if self.args.espeak_data_dir: | ||
+ piper_args.extend(["--espeak_data", str(self.args.espeak_data_dir)]) | ||
+ | ||
+ if self.args.cuda: | ||
+ piper_args.extend(["--debug"]) | ||
+ piper_args.extend(["--cuda"]) | ||
+ piper_args.extend(["--use-cuda"]) | ||
+ | ||
_LOGGER.debug( | ||
"Starting piper process: %s args=%s", self.args.piper, piper_args | ||
) |