Skip to content

Commit 2bf1285

Browse files
committed
modify ggml core to support tts
1 parent d876898 commit 2bf1285

File tree

3 files changed

+1117
-0
lines changed

3 files changed

+1117
-0
lines changed

ggml/include/ggml.h

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,18 @@ extern "C" {
553553
GGML_OP_GLU,
554554

555555
GGML_OP_COUNT,
556+
557+
//kcpp: dirtypatch of unofficial ops for ttscpp
558+
GGML_OP_UPSCALE_LINEAR, // linear interpolate
559+
GGML_OP_RECIPROCAL,
560+
GGML_OP_ROUND,
561+
GGML_OP_MOD,
562+
GGML_OP_CUMSUM,
563+
GGML_OP_STFT,
564+
GGML_OP_AA_STFT,
565+
GGML_OP_ISTFT,
566+
GGML_OP_AA_ISTFT,
567+
GGML_OP_CONV_TRANSPOSE_1D_TTS,
556568
};
557569

558570
enum ggml_unary_op {
@@ -2475,6 +2487,76 @@ extern "C" {
24752487
GGML_API void ggml_threadpool_params_init (struct ggml_threadpool_params * p, int n_threads);
24762488
GGML_API bool ggml_threadpool_params_match (const struct ggml_threadpool_params * p0, const struct ggml_threadpool_params * p1);
24772489

2490+
//kcpp: dirtypatch of ttscpp additions
2491+
GGML_API struct ggml_tensor * ggml_round(
2492+
struct ggml_context * ctx,
2493+
struct ggml_tensor * a);
2494+
GGML_API struct ggml_tensor * ggml_round_inplace(
2495+
struct ggml_context * ctx,
2496+
struct ggml_tensor * a);
2497+
// This is a floating point mod by the mod_val parameter
2498+
GGML_API struct ggml_tensor * ggml_mod(
2499+
struct ggml_context * ctx,
2500+
struct ggml_tensor * a,
2501+
float mod_val);
2502+
GGML_API struct ggml_tensor * ggml_mod_inplace(
2503+
struct ggml_context * ctx,
2504+
struct ggml_tensor * a,
2505+
float mod_val);
2506+
// reciprocal of each value in tensor a
2507+
GGML_API struct ggml_tensor * ggml_reciprocal(
2508+
struct ggml_context * ctx,
2509+
struct ggml_tensor * a);
2510+
GGML_API struct ggml_tensor * ggml_reciprocal_inplace(
2511+
struct ggml_context * ctx,
2512+
struct ggml_tensor * a);
2513+
// cumulative sums along first axis (ne0)
2514+
GGML_API struct ggml_tensor * ggml_cumsum(
2515+
struct ggml_context * ctx,
2516+
struct ggml_tensor * a);
2517+
GGML_API struct ggml_tensor * ggml_conv_1d_dw_tts(
2518+
struct ggml_context * ctx,
2519+
struct ggml_tensor * a, // convolution kernel
2520+
struct ggml_tensor * b, // data
2521+
int s0, // stride
2522+
int p0, // padding
2523+
int d0); // dilation
2524+
GGML_API struct ggml_tensor * ggml_conv_transpose_1d_tts(
2525+
struct ggml_context * ctx,
2526+
struct ggml_tensor * a, // convolution kernel
2527+
struct ggml_tensor * b, // data
2528+
int s0, // stride
2529+
int p0, // padding
2530+
int d0, // dilation
2531+
int op0, // output padding
2532+
int g0); // groups
2533+
GGML_API struct ggml_tensor * ggml_conv_1d_tts(
2534+
struct ggml_context * ctx,
2535+
struct ggml_tensor * a, // convolution kernel
2536+
struct ggml_tensor * b, // data
2537+
int s0, // stride
2538+
int p0, // padding
2539+
int d0); // dilation
2540+
GGML_API struct ggml_tensor * ggml_stft(
2541+
struct ggml_context * ctx,
2542+
struct ggml_tensor * a,
2543+
struct ggml_tensor * w, // the window
2544+
int filter_length,
2545+
int hop_length,
2546+
bool compute_abs_and_angle);
2547+
GGML_API struct ggml_tensor * ggml_istft(
2548+
struct ggml_context * ctx,
2549+
struct ggml_tensor * a, // magnitude + phase
2550+
struct ggml_tensor * w,
2551+
int filter_length,
2552+
int hop_length,
2553+
bool from_abs_and_angle);
2554+
GGML_API struct ggml_tensor * ggml_upscale_linear(
2555+
struct ggml_context * ctx,
2556+
struct ggml_tensor * a,
2557+
int scale_factor);
2558+
//end kcpp dirtypatch
2559+
24782560
#ifdef __cplusplus
24792561
}
24802562
#endif

0 commit comments

Comments
 (0)