Spaces:
Running
Running
talk : make compatible with c++11 (part 2)
Browse files- examples/talk.wasm/gpt-2.cpp +3 -1
- examples/talk/gpt-2.cpp +3 -1
examples/talk.wasm/gpt-2.cpp
CHANGED
|
@@ -533,7 +533,9 @@ bool gpt2_eval(
|
|
| 533 |
params.mem_buffer = buf;
|
| 534 |
|
| 535 |
struct ggml_context * ctx0 = ggml_init(params);
|
| 536 |
-
|
|
|
|
|
|
|
| 537 |
|
| 538 |
struct ggml_tensor * embd = ggml_new_tensor_1d(ctx0, GGML_TYPE_I32, N);
|
| 539 |
memcpy(embd->data, embd_inp.data(), N*ggml_element_size(embd));
|
|
|
|
| 533 |
params.mem_buffer = buf;
|
| 534 |
|
| 535 |
struct ggml_context * ctx0 = ggml_init(params);
|
| 536 |
+
|
| 537 |
+
struct ggml_cgraph gf = { };
|
| 538 |
+
gf.n_threads = n_threads;
|
| 539 |
|
| 540 |
struct ggml_tensor * embd = ggml_new_tensor_1d(ctx0, GGML_TYPE_I32, N);
|
| 541 |
memcpy(embd->data, embd_inp.data(), N*ggml_element_size(embd));
|
examples/talk/gpt-2.cpp
CHANGED
|
@@ -533,7 +533,9 @@ bool gpt2_eval(
|
|
| 533 |
params.mem_buffer = buf;
|
| 534 |
|
| 535 |
struct ggml_context * ctx0 = ggml_init(params);
|
| 536 |
-
|
|
|
|
|
|
|
| 537 |
|
| 538 |
struct ggml_tensor * embd = ggml_new_tensor_1d(ctx0, GGML_TYPE_I32, N);
|
| 539 |
memcpy(embd->data, embd_inp.data(), N*ggml_element_size(embd));
|
|
|
|
| 533 |
params.mem_buffer = buf;
|
| 534 |
|
| 535 |
struct ggml_context * ctx0 = ggml_init(params);
|
| 536 |
+
|
| 537 |
+
struct ggml_cgraph gf = { };
|
| 538 |
+
gf.n_threads = n_threads;
|
| 539 |
|
| 540 |
struct ggml_tensor * embd = ggml_new_tensor_1d(ctx0, GGML_TYPE_I32, N);
|
| 541 |
memcpy(embd->data, embd_inp.data(), N*ggml_element_size(embd));
|