fix(audio): use captions as the default YuE2 style (#12703)

* fix(audio): use captions as the default YuE2 style

Studio sends a caption, but YuE2 requires a style request option.
Default audio-cpp style from caption while preserving explicit options
and the caller's parameter map. Document the Studio fields.

Assisted-by: Codex:gpt-6
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* fix(audio-cpp): map captions to style in backend

Move the YuE2 caption fallback into the C++ request builder as requested.
Preserve explicit style options, including empty values, and move the
regression cases from the Go layer into the backend suite.

Assisted-by: Codex:GPT-6

---------

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Co-authored-by: localai-org-maint-bot <306269227+localai-org-maint-bot@users.noreply.github.com>
This commit is contained in:
localai-org-maint-botandlocalai-org-maint-bot authored and GitHub committed 2026-10-16 08:46:16 +02:00
1 parent fdfb171c3e
commit 62fa19b833
3 files changed
+47 -2

No files matched your search

+5 -2
View File
@@ -232,9 +232,12 @@ build_sound_generation_request(const backend::SoundGenerationRequest &request,
task.options["think"] = bool_option(request.think());
}
if (request.has_caption()) {
// Read only by irodori_tts, which advertises Tts/VoiceCloning/VoiceDesign
// and not AudioGeneration, so it is unreachable from this RPC: DEAD here.
task.options["caption"] = request.caption();
// YuE2 calls the musical caption "style". Preserve explicit options,
// including an empty style, while accepting Studio's caption field.
if (!request.caption().empty()) {
task.options.emplace("style", request.caption());
}
}
if (request.has_lyrics()) {
// Read by ace_step and heartmula.