Skip to content

Commit a02f501

Browse files
committed
working duration predictor
1 parent 66d1a97 commit a02f501

File tree

5 files changed

+122
-48
lines changed

5 files changed

+122
-48
lines changed

src/include/vits.h

+23-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class vits_model {
1717
int speaking_rate;
1818
std::unique_ptr<vits_model_data> model;
1919
struct ggml_context * ctx;
20-
struct ggml_tensor * last_hidden_state;
20+
struct ggml_tensor * debug_tensor;
2121
struct ggml_tensor * waveform;
2222
struct ggml_tensor * cum_duration_output;
2323
struct ggml_tensor * predicted_lengths_output;
@@ -55,6 +55,28 @@ class vits_model {
5555
struct ggml_tensor* conv_flow_graph(struct ggml_context* ctx, struct ggml_tensor * inputs, struct ggml_tensor* global_conditioning, bool reverse);
5656
struct ggml_tensor* stochastic_duration_predictor_graph(struct ggml_context* ctx, struct ggml_tensor * inputs, struct ggml_tensor* speaker_embeddings, bool reverse, float noise_scale_duration);
5757
struct ggml_tensor* hifigan_residual_block_graph(struct ggml_context *ctx, struct ggml_tensor *hidden_states, int kernel_size, std::vector<int> dilation, double leaky_relu_slope);
58+
struct ggml_tensor* unconstrained_rational_quadratic_spline(
59+
struct ggml_context* ctx,
60+
struct ggml_tensor* inputs,
61+
struct ggml_tensor* unnormalized_widths,
62+
struct ggml_tensor* unnormalized_heights,
63+
struct ggml_tensor* unnormalized_derivatives,
64+
bool reverse = false,
65+
float tail_bound = 5.0,
66+
float min_bin_width = 1e-3,
67+
float min_bin_height = 1e-3,
68+
float min_derivative = 1e-3);
69+
struct ggml_tensor* rational_quadratic_spline(
70+
struct ggml_context* ctx,
71+
struct ggml_tensor* inputs,
72+
struct ggml_tensor* unnormalized_widths,
73+
struct ggml_tensor* unnormalized_heights,
74+
struct ggml_tensor* unnormalized_derivatives,
75+
bool reverse = false,
76+
float tail_bound = 5.0,
77+
float min_bin_width = 1e-3,
78+
float min_bin_height = 1e-3,
79+
float min_derivative = 1e-3);
5880
std::vector<float> process(std::string phonemes);
5981
};
6082

src/include/vits_model_data.h

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ struct vits_model_data {
3131
std::unique_ptr<prefix_guard> use(std::string name);
3232

3333
struct ggml_tensor* get(std::string name) const;
34+
35+
std::string current_prefix() const;
3436
};
3537

3638

0 commit comments

Comments
 (0)