Skip to content

Commit f766100

Browse files
committed
tts : fix sampling + cut initial noise
1 parent ef27367 commit f766100

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

examples/tts/tts.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ int main(int argc, char ** argv) {
295295
params.n_batch = 8192;
296296
params.n_ctx = 8192;
297297

298-
params.sampling.top_k = 128;
298+
params.sampling.top_k = 4;
299299
params.sampling.penalty_repeat = 1.1;
300300
params.sampling.penalty_last_n = 8;
301301
params.sampling.samplers = { COMMON_SAMPLER_TYPE_TEMPERATURE, COMMON_SAMPLER_TYPE_TOP_K, };
@@ -744,6 +744,11 @@ lovely<|t_0.56|><|code_start|><|634|><|596|><|1766|><|1556|><|1306|><|1285|><|14
744744

745745
const int n_sr = 24000; // sampling rate
746746

747+
// zero out first 0.25 seconds
748+
for (int i = 0; i < 24000/4; ++i) {
749+
audio[i] = 0.0f;
750+
}
751+
747752
LOG_INF("%s: time for spectral ops: %.3f ms\n", __func__, (ggml_time_us() - t_spec_start) / 1000.0f);
748753
LOG_INF("%s: total time: %.3f ms\n", __func__, (ggml_time_us() - t_main_start) / 1000.0f);
749754

0 commit comments

Comments
 (0)