Skip to content

Commit

Permalink
sync: sync to latest GGML api (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
PABannier committed Oct 1, 2023
1 parent 94775ca commit 6157db7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions encodec.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <cmath>
#include <cstring>
#include <stdexcept>
#include <fstream>
#include <map>
Expand Down Expand Up @@ -525,7 +526,6 @@ static void encodec_model_eval(

struct ggml_context * ctx0 = ggml_init(params);
struct ggml_cgraph gf = {};
gf.n_threads = n_threads;

struct ggml_tensor * inp = ggml_new_tensor_1d(ctx0, GGML_TYPE_F32, raw_audio.size());
memcpy(inp->data, raw_audio.data(), raw_audio.size()*ggml_element_size(inp));
Expand Down Expand Up @@ -748,8 +748,8 @@ static void encodec_model_eval(
out = decoded_inp;
}

ggml_build_forward_expand(&gf, out);
ggml_graph_compute (ctx0, &gf);
ggml_build_forward_expand (&gf, out);
ggml_graph_compute_with_ctx(ctx0, &gf, n_threads);

ggml_free(ctx0);
}

0 comments on commit 6157db7

Please sign in to comment.