Skip to content

Commit c43af92

Browse files
dm4ggerganov
andauthored
tts: add speaker file support (#12048)
* tts: add speaker file support Signed-off-by: dm4 <[email protected]> * tts: handle outetts-0.3 * tts : add new line in error message --------- Signed-off-by: dm4 <[email protected]> Co-authored-by: Georgi Gerganov <[email protected]>
1 parent d5c63cd commit c43af92

File tree

3 files changed

+258
-140
lines changed

3 files changed

+258
-140
lines changed

common/arg.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -2452,6 +2452,13 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
24522452
params.vocoder.use_guide_tokens = true;
24532453
}
24542454
).set_examples({LLAMA_EXAMPLE_TTS, LLAMA_EXAMPLE_SERVER}));
2455+
add_opt(common_arg(
2456+
{"--tts-speaker-file"}, "FNAME",
2457+
"speaker file path for audio generation",
2458+
[](common_params & params, const std::string & value) {
2459+
params.vocoder.speaker_file = value;
2460+
}
2461+
).set_examples({LLAMA_EXAMPLE_TTS}));
24552462

24562463
// model-specific
24572464
add_opt(common_arg(

common/common.h

+2
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)