Skip to content

Commit 9a3be28

Browse files
committed
talk : make compatible with c++11 (part 2)
1 parent bc1a47c commit 9a3be28

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

examples/talk.wasm/gpt-2.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,9 @@ bool gpt2_eval(
533533
params.mem_buffer = buf;
534534

535535
struct ggml_context * ctx0 = ggml_init(params);
536-
struct ggml_cgraph gf = { .n_threads = n_threads };
536+
537+
struct ggml_cgraph gf = { };
538+
gf.n_threads = n_threads;
537539

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

examples/talk/gpt-2.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,9 @@ bool gpt2_eval(
533533
params.mem_buffer = buf;
534534

535535
struct ggml_context * ctx0 = ggml_init(params);
536-
struct ggml_cgraph gf = { .n_threads = n_threads };
536+
537+
struct ggml_cgraph gf = { };
538+
gf.n_threads = n_threads;
537539

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

0 commit comments

Comments
 (0)