diff --git a/ggml/include/ggml.h b/ggml/include/ggml.h index 1a18b3bdc..4fb929387 100644 --- a/ggml/include/ggml.h +++ b/ggml/include/ggml.h @@ -571,7 +571,7 @@ extern "C" { GGML_OP_RECIPROCAL, GGML_OP_TTSROUND, GGML_OP_MOD, - GGML_OP_CUMSUM, + GGML_OP_CUMSUM_TTS, GGML_OP_STFT, GGML_OP_AA_STFT, GGML_OP_ISTFT, @@ -2658,7 +2658,7 @@ extern "C" { struct ggml_context * ctx, struct ggml_tensor * a); // cumulative sums along first axis (ne0) - GGML_API struct ggml_tensor * ggml_cumsum( + GGML_API struct ggml_tensor * ggml_cumsum_tts( struct ggml_context * ctx, struct ggml_tensor * a); GGML_API struct ggml_tensor * ggml_conv_1d_dw_tts( diff --git a/ggml/src/ggml-cpu/ggml-cpu.c b/ggml/src/ggml-cpu/ggml-cpu.c index c7843dae9..bf2b033b7 100644 --- a/ggml/src/ggml-cpu/ggml-cpu.c +++ b/ggml/src/ggml-cpu/ggml-cpu.c @@ -1717,7 +1717,7 @@ static void ggml_compute_forward_reciprocal( } } } -static void ggml_compute_forward_cumsum_f32( +static void ggml_compute_forward_cumsum_f32_tts( const struct ggml_compute_params * params, struct ggml_tensor * dst) { const struct ggml_tensor * src0 = dst->src[0]; @@ -1751,7 +1751,7 @@ static void ggml_compute_forward_cumsum_f32( } } } -static void ggml_compute_forward_cumsum( +static void ggml_compute_forward_cumsum_tts( const struct ggml_compute_params * params, struct ggml_tensor * dst) { @@ -1760,7 +1760,7 @@ static void ggml_compute_forward_cumsum( switch (src0->type) { case GGML_TYPE_F32: { - ggml_compute_forward_cumsum_f32(params, dst); + ggml_compute_forward_cumsum_f32_tts(params, dst); } break; default: { @@ -2839,9 +2839,9 @@ static void ggml_compute_forward(struct ggml_compute_params * params, struct ggm { ggml_compute_forward_ttsround(params, tensor); } break; - case GGML_OP_CUMSUM: + case GGML_OP_CUMSUM_TTS: { - ggml_compute_forward_cumsum(params, tensor); + ggml_compute_forward_cumsum_tts(params, tensor); } break; case GGML_OP_MOD: { @@ -3188,7 +3188,7 @@ static int ggml_get_n_tasks(struct ggml_tensor * node, int n_threads) { case GGML_OP_RECIPROCAL: //kcpp: dirtypatch tts cpp case GGML_OP_MOD: case GGML_OP_TTSROUND: - case GGML_OP_CUMSUM: + case GGML_OP_CUMSUM_TTS: case GGML_OP_STFT: case GGML_OP_AA_STFT: case GGML_OP_ISTFT: diff --git a/ggml/src/ggml.c b/ggml/src/ggml.c index cda0274ea..5db4b2d16 100644 --- a/ggml/src/ggml.c +++ b/ggml/src/ggml.c @@ -7489,11 +7489,11 @@ struct ggml_tensor * ggml_mod_inplace( float mod_val) { return ggml_mod_impl(ctx, a, mod_val, true); } -struct ggml_tensor * ggml_cumsum( +struct ggml_tensor * ggml_cumsum_tts( struct ggml_context * ctx, struct ggml_tensor * a) { struct ggml_tensor * result = ggml_dup_tensor(ctx, a); - result->op = GGML_OP_CUMSUM; + result->op = GGML_OP_CUMSUM_TTS; result->src[0] = a; return result; } diff --git a/otherarch/ttscpp/src/kokoro_model.cpp b/otherarch/ttscpp/src/kokoro_model.cpp index 5dde33afc..c7543ac93 100644 --- a/otherarch/ttscpp/src/kokoro_model.cpp +++ b/otherarch/ttscpp/src/kokoro_model.cpp @@ -173,7 +173,7 @@ static struct ggml_tensor * build_noise_block(ggml_context * ctx, kokoro_noise_r static struct ggml_tensor * build_sin_gen(ggml_context * ctx, kokoro_model * model, kokoro_context * kctx, struct ggml_tensor * x, int harmonic_num, int sequence_length, float voice_threshold, float sin_amp, float noise_std) { struct ggml_tensor * cur = ggml_mul(ctx, ggml_repeat(ctx, x, ggml_new_tensor_2d(ctx, GGML_TYPE_F32, x->ne[0], harmonic_num)), model->harmonic_sampling_norm); - cur = ggml_mul(ctx, ggml_cumsum(ctx, ggml_mod(ctx, cur, 1.0f)), model->sampling_factor_scalar); + cur = ggml_mul(ctx, ggml_cumsum_tts(ctx, ggml_mod(ctx, cur, 1.0f)), model->sampling_factor_scalar); cur = ggml_upscale_linear(ctx, cur, 300); struct ggml_tensor * upscaled = ggml_upscale_ext(ctx, x, x->ne[0]*300, x->ne[1], x->ne[2], x->ne[3],GGML_SCALE_MODE_NEAREST);