Skip to content

Commit

Permalink
remove tts audio caching
Browse files Browse the repository at this point in the history
  • Loading branch information
LostRuins committed Feb 12, 2025
1 parent b162c25 commit 71016db
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 20 deletions.
1 change: 0 additions & 1 deletion expose.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
3 changes: 2 additions & 1 deletion klite.embd
Original file line number Diff line number Diff line change
Expand Up @@ -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>")
Expand Down Expand Up @@ -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();
Expand Down
4 changes: 1 addition & 3 deletions koboldcpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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:
Expand Down
15 changes: 0 additions & 15 deletions otherarch/tts_adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 71016db

Please sign in to comment.