use ISO 639-1 language code

This commit is contained in:
Xuan Son Nguyen
2026-08-03 00:01:56 +02:00
parent 0b6e340205
commit 1df59d388e
3 changed files with 10 additions and 7 deletions
+1 -1
View File
@@ -4229,7 +4229,7 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
add_opt(common_arg(
{"--tts-lang"}, "FNAME",
"language (two-letter country code) for audio generation\n"
"language (ISO 639-1) for audio generation\n"
"see tts/README.md for per-model usage notes",
[](common_params & params, const std::string & value) {
params.tts_lang = value;
+8 -5
View File
@@ -19,15 +19,18 @@
// Audio generation helpers
//
// maps the 2-letter --tts-lang codes (see tools/tts/README.md) to the language
// maps the --tts-lang codes (see tools/tts/README.md) to the language
// names used by the codec_language special tokens
//
// primary keys are ISO 639-1 codes; the old non-standard codes ("cn", "ge",
// "po", "sp") are kept as aliases for backward compatibility
static const std::unordered_map<std::string, std::string> tts_lang_codes = {
{ "cn", "chinese" },
{ "zh", "chinese" },
{ "en", "english" },
{ "ge", "german" },
{ "de", "german" },
{ "it", "italian" },
{ "po", "portuguese" },
{ "sp", "spanish" },
{ "pt", "portuguese" },
{ "es", "spanish" },
{ "ja", "japanese" },
{ "ko", "korean" },
{ "fr", "french" },
+1 -1
View File
@@ -20,7 +20,7 @@ Common params:
## Qwen3-TTS
Available params:
- `--tts-lang` can be `cn`, `en`, `ge`, `it`, `po`, `sp`, `ja`, `ko`, `fr`, `ru` (default: `en`)
- `--tts-lang` can be `zh`, `en`, `de`, `it`, `pt`, `es`, `ja`, `ko`, `fr`, `ru` (default: `en`)
- `--tts-speaker-file` should point to a speaker reference audio file (wav, mp3)
Example usage: