Skip to content

Commit

Permalink
tts: add speaker file support
Browse files Browse the repository at this point in the history
Signed-off-by: dm4 <[email protected]>
  • Loading branch information
dm4 committed Feb 24, 2025
1 parent 7ad0779 commit ea8711d
Show file tree
Hide file tree
Showing 3 changed files with 208 additions and 136 deletions.
7 changes: 7 additions & 0 deletions common/arg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2447,6 +2447,13 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
params.vocoder.use_guide_tokens = true;
}
).set_examples({LLAMA_EXAMPLE_TTS, LLAMA_EXAMPLE_SERVER}));
add_opt(common_arg(
{"--tts-speaker-file"}, "FNAME",
"speaker file path for audio generation",
[](common_params & params, const std::string & value) {
params.vocoder.speaker_file = value;
}
).set_examples({LLAMA_EXAMPLE_TTS, LLAMA_EXAMPLE_SERVER}));

// model-specific
add_opt(common_arg(
Expand Down
2 changes: 2 additions & 0 deletions common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ struct common_params_vocoder {
std::string model = ""; // model path // NOLINT
std::string model_url = ""; // model url to download // NOLINT

std::string speaker_file = ""; // speaker file path // NOLINT

bool use_guide_tokens = false; // enable guide tokens to improve TTS accuracy // NOLINT
};

Expand Down
Loading

0 comments on commit ea8711d

Please sign in to comment.