mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-05-10 04:00:53 +00:00
rename ggml_cumsum for tts
This commit is contained in:
parent
a67f097de3
commit
85060da3ce
4 changed files with 11 additions and 11 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue