tts can now set a length limit

This commit is contained in:
Concedo
2025-01-28 22:06:59 +08:00
8 changed files with 235 additions and 119 deletions
+4 -1
View File
@@ -478,6 +478,7 @@ static int cts_offset = 151672;
static int space_id = 151670;
static int code_terminate_id = 151670;
static int nthreads = 4;
static int tts_max_len = 4096;
bool ttstype_load_model(const tts_load_model_inputs inputs)
{
@@ -522,6 +523,8 @@ bool ttstype_load_model(const tts_load_model_inputs inputs)
nthreads = inputs.threads;
tts_max_len = inputs.ttsmaxlen;
tts_model_params.use_mmap = false;
tts_model_params.use_mlock = false;
tts_model_params.n_gpu_layers = inputs.gpulayers; //offload if possible
@@ -871,7 +874,7 @@ tts_generation_outputs ttstype_generate(const tts_generation_inputs inputs)
// main loop
n_decode = 0;
n_predict = 4096; //max 4096 tokens
n_predict = tts_max_len; //max 4096 tokens
while (n_decode <= n_predict)
{