Skip to content

Commit

Permalink
intiial
Browse files Browse the repository at this point in the history
  • Loading branch information
PABannier committed Oct 26, 2024
1 parent 1af1a61 commit cb17d76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion encodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,9 @@ void encodec_build_graph(struct encodec_context *ectx, const int32_t *codes,

static void encodec_zero_tensor(struct ggml_cgraph *gf, const char *name) {
struct ggml_tensor *tensor = ggml_graph_get_tensor(gf, name);
ggml_set_zero(tensor);
// create a zero array
// ggml_backend_tensor_set(tensor, zeros, 0, tensor->ne * ggml_element_size(tensor));
// ggml_set_zero(tensor);
}

bool encodec_eval_internal(struct encodec_context *ectx, const float * raw_audio,
Expand Down
3 changes: 1 addition & 2 deletions quantizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ struct ggml_tensor *encodec_forward_quantizer_encode(
// [seq_length, n_bins]
struct ggml_tensor *dist = ggml_add(ctx0, ggml_repeat(ctx0, sqr_inp_nrm, dp), dp);
dist = ggml_add(ctx0, ggml_repeat(ctx0, ggml_transpose(ctx0, sqr_embed_nrm), dist), dist);
dist = ggml_neg(ctx0, dist);
dist = ggml_scale(ctx0, dist, -1.0f);

// take the argmax over the column dimension
// [seq_length]
indices = ggml_argmax(ctx0, dist);

Expand Down

0 comments on commit cb17d76

Please sign in to comment.