You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ability to change fallback for missing lang_code #153
Hi' I'd like to be able to change the fallback behaviour for the language selection when the API request doesn't specify a lang_code.
At the moment, it automatically selects the language based on the voice file. I'd like to be able to override that in the config file. This will give access to a lot more variety of voices in other apps.
I've gone and kludged the code directly to change the fallback, and it works quite nicely, but I don't have the coding skill to make it just an easy to change config file option.
Line under the comment "# Use provided lang_code or get from voice name" in kokoro_v1.py is where the logic happens.
Thanks! And great work so far - this is by far the best option for TTS I've tried on my mac!
Thanks! Glad it's working for you! And I was making a change on the dockerfile, and was able to sneak this in on the main branch at 24b31cc. Let me know if it's what you had in mind. Haven't tested it completely, but will take a further look tomorrow
You should be able to set the voice/lang_code as an environment variable on run via the below command, or manually editing the config file for uv run/docker compose
docker run -p 8880:8880 -e DEFAULT_VOICE_CODE=e ghcr.io/remsky/kokoro-fastapi-cpu:v0.2.1
Activity
remsky commentedon Feb 11, 2025
Thanks! Glad it's working for you! And I was making a change on the dockerfile, and was able to sneak this in on the main branch at
24b31cc. Let me know if it's what you had in mind. Haven't tested it completely, but will take a further look tomorrow
You should be able to set the voice/lang_code as an environment variable on run via the below command, or manually editing the config file for uv run/docker compose
docker run -p 8880:8880 -e DEFAULT_VOICE_CODE=e ghcr.io/remsky/kokoro-fastapi-cpu:v0.2.1It's just building to v0.2.1post1 here https://github.com/remsky/Kokoro-FastAPI/actions/runs/13262317639 as the prebuilt image