]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
talk : make compatible with c++11
authorGeorgi Gerganov <redacted>
Sun, 11 Dec 2022 18:19:17 +0000 (20:19 +0200)
committerGeorgi Gerganov <redacted>
Sun, 11 Dec 2022 18:19:17 +0000 (20:19 +0200)
examples/talk.wasm/gpt-2.cpp
examples/talk/gpt-2.cpp

index 0bffe72b24fd414853ebca1ce60af1f350ab6b91..3cdc2c2e245957cdfb51e115f9c07852143cbe5e 100644 (file)
@@ -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 };
index 1adb9778fc39adf4bacb7eb82e4441c23029e339..6ef2496253dc2f4a2be86ed9f46770bc9ef24154 100644 (file)
@@ -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 };