]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
ref #62 : fix build for some compilers
authorGeorgi Gerganov <redacted>
Tue, 18 Oct 2022 07:56:37 +0000 (10:56 +0300)
committerGeorgi Gerganov <redacted>
Tue, 18 Oct 2022 07:57:03 +0000 (10:57 +0300)
For some reason, new version of GCC panic when the struct type is not
specified explicitly

.gitignore
whisper.cpp

index b34c5126fb1d18b61a2049b3c22d91cdbfadd0d4..f7e302c4657b1dd670738e424aa7e1c4aa6655c5 100644 (file)
@@ -5,6 +5,8 @@ stream
 .cache
 build/
 build-em/
+build-debug/
+build-release/
 out/
 .vs/
 .vscode/
index 8ef20cb85e61f3ef57c138ca774386220a557836..61d0a8a249d803d558a6262aadf99f153613c32f 100644 (file)
@@ -2262,7 +2262,11 @@ struct whisper_full_params whisper_full_default_params(enum whisper_decode_strat
     switch (strategy) {
         case WHISPER_DECODE_GREEDY:
             {
+#if defined(_MSC_VER)
                 result = {
+#else
+                result = (struct whisper_full_params) {
+#endif
                     .strategy  = WHISPER_DECODE_GREEDY,
                     .n_threads = std::min(4, (int32_t) std::thread::hardware_concurrency()),
                     .offset_ms = 0,
@@ -2283,8 +2287,12 @@ struct whisper_full_params whisper_full_default_params(enum whisper_decode_strat
             } break;
         case WHISPER_DECODE_BEAM_SEARCH:
             {
+#if defined(_MSC_VER)
                 result = {
-                    .strategy  = WHISPER_DECODE_GREEDY,
+#else
+                result = (struct whisper_full_params) {
+#endif
+                    .strategy  = WHISPER_DECODE_BEAM_SEARCH,
                     .n_threads = std::min(4, (int32_t) std::thread::hardware_concurrency()),
                     .offset_ms = 0,