MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / get_tts_version

Function get_tts_version

subprojects/llama.cpp/tools/tts/tts.cpp:477–497  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

475}
476
477static outetts_version get_tts_version(llama_model *model, json speaker = json::object()) {
478 if (speaker.contains("version")) {
479 std::string version = speaker["version"].get<std::string>();
480 if (version == "0.2") {
481 return OUTETTS_V0_2;
482 } else if (version == "0.3") {
483 return OUTETTS_V0_3;
484 } else {
485 LOG_ERR("%s: Unsupported speaker version '%s'\n", __func__, version.c_str());
486 }
487 }
488
489 // Also could get version from model itself
490 const char *chat_template = llama_model_chat_template(model, nullptr);
491 if (chat_template && std::string(chat_template) == "outetts-0.3") {
492 return OUTETTS_V0_3;
493 }
494
495 // Use 0.2 as the default version
496 return OUTETTS_V0_2;
497}
498
499static std::string audio_text_from_speaker(json speaker, const outetts_version tts_version = OUTETTS_V0_2) {
500 std::string audio_text = "<|text_start|>";

Callers 1

mainFunction · 0.85

Calls 3

stringClass · 0.85
containsMethod · 0.65

Tested by

no test coverage detected