mtmd: Pocket TTS - add generic support for temperature set via API (#31655)

* mtmd, server : add temperature to /tts, default Pocket TTS to 0.3

Assisted-by: Claude Opus 5.5

* feat: add temp parameter in llama-tts

* temp: fix default hardcoded values

* fix: remove too narrow test

* fix: addressing PR comments
This commit is contained in:
Marco Colombo authored and GitHub committed 2026-11-09 11:20:45 +01:00
1 parent cf92c1323f
commit 2d99adb108
10 files changed
+44 -26

No files matched your search

+4 -1
View File
@@ -6485,7 +6485,7 @@ void server_routes::init_routes() {
body[k] = std::stoll(body[k].get<std::string>());
}
}
for (const char * k : { "top_p", "repeat_penalty" }) {
for (const char * k : { "top_p", "temperature", "repeat_penalty" }) {
if (body.contains(k) && body[k].is_string()) {
body[k] = std::stof(body[k].get<std::string>());
}
@@ -6533,6 +6533,9 @@ void server_routes::init_routes() {
if (task.tts_inp.data.top_p > 0) {
task.params.sampling.top_p = task.tts_inp.data.top_p;
}
if (task.tts_inp.data.temp >= 0) {
task.params.sampling.temp = task.tts_inp.data.temp;
}
// speaker reference: either an uploaded form file ("speaker_ref") or a base64 JSON field ("speaker_ref_b64")
const unsigned char * speaker_ref_data = nullptr;