feat: Add Norwegian and improve Apple Silicon support#1
Closed
haqatak wants to merge 4 commits intobrianferri:mainfrom
Closed
feat: Add Norwegian and improve Apple Silicon support#1haqatak wants to merge 4 commits intobrianferri:mainfrom
haqatak wants to merge 4 commits intobrianferri:mainfrom
Conversation
This commit introduces two key enhancements:
1. **Norwegian Language Support:**
- Adds support for Norwegian Bokmål (`nb`) and Norwegian Nynorsk (`nn`) through the `espeak-ng` integration.
- Includes aliases (`no`, `no-nb`, `nn`, `no-nn`) for easier use.
2. **Apple Silicon (MPS) Support:**
- Updates the device selection logic in `kokoro/pipeline.py` to automatically detect and use the MPS backend on Apple Silicon devices.
- Removes the requirement for the `PYTORCH_ENABLE_MPS_FALLBACK` environment variable, streamlining the user experience.
This commit fixes a `mutex lock failed` runtime error on macOS by pre-loading the `espeak-ng` library. This is achieved by importing `misaki.espeak` at the top of `kokoro/__init__.py`, which ensures that `espeak-ng` is initialized before any other conflicting libraries are loaded.
This commit introduces several key changes:
1. **Fix for macOS Runtime Error:**
- Resolves a `mutex lock failed` runtime error on macOS by pre-loading the `espeak-ng` library. This is achieved by importing `misaki.espeak` at the top of `kokoro/__init__.py`, which ensures that `espeak-ng` is initialized before any other conflicting libraries are loaded.
2. **Norwegian Language Support:**
- Adds support for Norwegian Bokmål (`nb`) and Norwegian Nynorsk (`nn`) through the `espeak-ng` integration.
- Includes aliases (`no`, `no-nb`, `nn`, `no-nn`) for easier use.
- Updates the `README.md` to include instructions for using the new Norwegian language models.
3. **Apple Silicon (MPS) Support:**
- Updates the device selection logic in `kokoro/pipeline.py` to automatically detect and use the MPS backend on Apple Silicon devices.
- Removes the requirement for the `PYTORCH_ENABLE_MPS_FALLBACK` environment variable, streamlining the user experience.
…nd expand language support.
1. **Fix macOS IPython Crash:** Resolves a `libc++abi: terminating due to uncaught exception of type std::__1::system_error: mutex lock failed: Invalid argument` error that occurred when importing the library within an IPython session on macOS. This is fixed by pre-loading the `espeak-ng` native library by importing `misaki.espeak` at the top of the package's `__init__.py`. This ensures it is initialized before other conflicting libraries loaded by IPython.
2. **Add Norwegian Language Support:**
- Adds language codes for Norwegian Bokmål (`nb`) and Norwegian Nynorsk (`nn`) to the pipeline, utilizing the existing `espeak-ng` backend.
- Updates the `README.md` to include usage instructions for the new languages.
3. **Improve Apple Silicon (MPS) Support:**
- Removes the check for the `PYTORCH_ENABLE_MPS_FALLBACK` environment variable. The library will now automatically select the `mps` backend if it is available on the system, simplifying the setup for users on Apple Silicon devices.
Owner
|
Hi @haqatak! Thanks for the PR. however this is just a fork of the Kokoro project with it's own PR currently awaiting attention. |
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.
This commit introduces two key enhancements:
Norwegian Language Support:
nb) and Norwegian Nynorsk (nn) through theespeak-ngintegration.no,no-nb,nn,no-nn) for easier use.Apple Silicon (MPS) Support:
kokoro/pipeline.pyto automatically detect and use the MPS backend on Apple Silicon devices.PYTORCH_ENABLE_MPS_FALLBACKenvironment variable, streamlining the user experience.