From: Georgi Gerganov Date: Sun, 11 Dec 2022 18:19:17 +0000 (+0200) Subject: talk : make compatible with c++11 X-Git-Tag: upstream/1.7.4~1730 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=444349f4ec6fdc9d0d2bb3128add10da3c701a8a;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp talk : make compatible with c++11 --- diff --git a/examples/talk.wasm/gpt-2.cpp b/examples/talk.wasm/gpt-2.cpp index 0bffe72b..3cdc2c2e 100644 --- a/examples/talk.wasm/gpt-2.cpp +++ b/examples/talk.wasm/gpt-2.cpp @@ -325,10 +325,9 @@ bool gpt2_model_load(const std::string & fname, gpt2_model & model, gpt_vocab & // create the ggml context { - struct ggml_init_params params = { - .mem_size = ctx_size, - .mem_buffer = NULL, - }; + struct ggml_init_params params; + params.mem_size = ctx_size; + params.mem_buffer = NULL; model.ctx = ggml_init(params); if (!model.ctx) { @@ -529,10 +528,9 @@ bool gpt2_eval( } } - struct ggml_init_params params = { - .mem_size = buf_size, - .mem_buffer = buf, - }; + struct ggml_init_params params; + params.mem_size = buf_size; + params.mem_buffer = buf; struct ggml_context * ctx0 = ggml_init(params); struct ggml_cgraph gf = { .n_threads = n_threads }; diff --git a/examples/talk/gpt-2.cpp b/examples/talk/gpt-2.cpp index 1adb9778..6ef24962 100644 --- a/examples/talk/gpt-2.cpp +++ b/examples/talk/gpt-2.cpp @@ -325,10 +325,9 @@ bool gpt2_model_load(const std::string & fname, gpt2_model & model, gpt_vocab & // create the ggml context { - struct ggml_init_params params = { - .mem_size = ctx_size, - .mem_buffer = NULL, - }; + struct ggml_init_params params; + params.mem_size = ctx_size; + params.mem_buffer = NULL; model.ctx = ggml_init(params); if (!model.ctx) { @@ -529,10 +528,9 @@ bool gpt2_eval( } } - struct ggml_init_params params = { - .mem_size = buf_size, - .mem_buffer = buf, - }; + struct ggml_init_params params; + params.mem_size = buf_size; + params.mem_buffer = buf; struct ggml_context * ctx0 = ggml_init(params); struct ggml_cgraph gf = { .n_threads = n_threads };