Skip to content

Commit

Permalink
talk : make compatible with c++11 (part 2)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggerganov committed Dec 11, 2022
1 parent 444349f commit aa6adda
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion examples/talk.wasm/gpt-2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,9 @@ bool gpt2_eval(
params.mem_buffer = buf;

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

struct ggml_cgraph gf = { };
gf.n_threads = n_threads;

struct ggml_tensor * embd = ggml_new_tensor_1d(ctx0, GGML_TYPE_I32, N);
memcpy(embd->data, embd_inp.data(), N*ggml_element_size(embd));
Expand Down
4 changes: 3 additions & 1 deletion examples/talk/gpt-2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,9 @@ bool gpt2_eval(
params.mem_buffer = buf;

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

struct ggml_cgraph gf = { };
gf.n_threads = n_threads;

struct ggml_tensor * embd = ggml_new_tensor_1d(ctx0, GGML_TYPE_I32, N);
memcpy(embd->data, embd_inp.data(), N*ggml_element_size(embd));
Expand Down

0 comments on commit aa6adda

Please sign in to comment.