Allow using the system espeak-ng instead of the bundled one#150
Open
Amithtraj wants to merge 1 commit into
Open
Allow using the system espeak-ng instead of the bundled one#150Amithtraj wants to merge 1 commit into
Amithtraj wants to merge 1 commit into
Conversation
Respect the standard PHONEMIZER_ESPEAK_LIBRARY environment variable: when set, phonemizer is pointed at that library and the one bundled with espeakng_loader is not loaded. A user-provided ESPEAK_DATA_PATH is no longer overwritten. espeakng_loader import failure is tolerated so the package is not required when a system espeak-ng is configured. Fixes KittenML#149
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
LMAO! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #149
KittenTTS currently hardwires phonemizer to the espeak-ng library bundled with
espeakng_loaderat import time, and overwrites any user-setESPEAK_DATA_PATH. Users who already have espeak-ng installed (e.g. a locally optimized build) have no way to use it.Changes
PHONEMIZER_ESPEAK_LIBRARYenvironment variable: when set, phonemizer is pointed at that library and the bundled one is not loaded.ESPEAK_DATA_PATH(setdefaultinstead of unconditional overwrite).espeakng_loaderimport failure, so the package is not required when a system espeak-ng is configured via the env var.Default behavior is unchanged: with no env vars set, the bundled library is used exactly as before. No API changes.
Testing
PHONEMIZER_ESPEAK_LIBRARY/ESPEAK_DATA_PATHpointing at a system espeak-ng (Homebrew, macOS) that phonemization and fullKittenTTS(...).generate()synthesis run through the system library.espeakng_loaderuninstalled and the env vars set.