remove tts audio caching

This commit is contained in:
Concedo 2025-02-12 11:37:43 +08:00
parent b162c25a5e
commit 71016db617
4 changed files with 3 additions and 20 deletions

View file

@ -224,7 +224,6 @@ struct tts_generation_inputs
const char * prompt = nullptr;
const int speaker_seed = 0;
const int audio_seed = 0;
const bool nocache = false;
};
struct tts_generation_outputs
{

View file

@ -5298,6 +5298,8 @@ Current version indicated by LITEVER below.
.replace(/<\/ul>\n<ul>/g, "")
.replace(/<\/li><\/ul>\n\s*?\n<ul><li>/gm, "</li>\n<li>")
.replace(/<\/li><\/ul>\s*?<ul><li>/gm, "</li><li>")
.replace(/<\/ul>\n/gm, "</ul>")
.replace(/<\/ol>\n/gm, "</ol>")
.replace(/\*\*\*([^\s*].*?[^\\])\*\*\*/gm, "<b><em>$1</em></b>")
.replace(/\*\*([^\s*].*?[^\\])\*\*/gm, "<b>$1</b>")
@ -12736,7 +12738,6 @@ Current version indicated by LITEVER below.
payload =
{
"input": text,
"nocache": true,
"voice": (document.getElementById("kcpp_tts_voice").value == "custom")?document.getElementById("kcpp_tts_voice_custom").value:document.getElementById("kcpp_tts_voice").value
};
ttsheaders = get_kobold_header();

View file

@ -304,8 +304,7 @@ class tts_load_model_inputs(ctypes.Structure):
class tts_generation_inputs(ctypes.Structure):
_fields_ = [("prompt", ctypes.c_char_p),
("speaker_seed", ctypes.c_int),
("audio_seed", ctypes.c_int),
("nocache", ctypes.c_bool)]
("audio_seed", ctypes.c_int)]
class tts_generation_outputs(ctypes.Structure):
_fields_ = [("status", ctypes.c_int),
@ -1491,7 +1490,6 @@ def tts_generate(genparams):
except Exception:
aseed = -1
inputs.audio_seed = aseed
inputs.nocache = genparams.get("nocache", False)
ret = handle.tts_generate(inputs)
outstr = ""
if ret.status==1:

View file

@ -638,21 +638,6 @@ tts_generation_outputs ttstype_generate(const tts_generation_inputs inputs)
std::mt19937 tts_rng(audio_seed);
std::mt19937 speaker_rng(speaker_seed);
//if we can reuse an old generation, do so
if(!inputs.nocache
&& last_generation_settings_audio_seed == inputs.audio_seed
&& last_generation_settings_speaker_seed == inputs.speaker_seed
&& last_generated_audio!=""
&& last_generation_settings_prompt == std::string(inputs.prompt))
{
if (ttsdebugmode == 1 && !tts_is_quiet) {
printf("\nReusing Cached Audio.\n");
}
output.data = last_generated_audio.c_str();
output.status = 1;
return output;
}
int n_decode = 0;
int n_predict = 2048; //will be updated later