Skip to content

Commit ea8711d

Browse files
committed
tts: add speaker file support
Signed-off-by: dm4 <[email protected]>
1 parent 7ad0779 commit ea8711d

File tree

3 files changed

+208
-136
lines changed

3 files changed

+208
-136
lines changed

common/arg.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2447,6 +2447,13 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
24472447
params.vocoder.use_guide_tokens = true;
24482448
}
24492449
).set_examples({LLAMA_EXAMPLE_TTS, LLAMA_EXAMPLE_SERVER}));
2450+
add_opt(common_arg(
2451+
{"--tts-speaker-file"}, "FNAME",
2452+
"speaker file path for audio generation",
2453+
[](common_params & params, const std::string & value) {
2454+
params.vocoder.speaker_file = value;
2455+
}
2456+
).set_examples({LLAMA_EXAMPLE_TTS, LLAMA_EXAMPLE_SERVER}));
24502457

24512458
// model-specific
24522459
add_opt(common_arg(

common/common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ struct common_params_vocoder {
200200
std::string model = ""; // model path // NOLINT
201201
std::string model_url = ""; // model url to download // NOLINT
202202

203+
std::string speaker_file = ""; // speaker file path // NOLINT
204+
203205
bool use_guide_tokens = false; // enable guide tokens to improve TTS accuracy // NOLINT
204206
};
205207

0 commit comments

Comments
 (0)