]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
whisper : minor sync
authorGeorgi Gerganov <redacted>
Tue, 5 Sep 2023 13:37:55 +0000 (16:37 +0300)
committerGeorgi Gerganov <redacted>
Tue, 5 Sep 2023 13:37:55 +0000 (16:37 +0300)
examples/whisper/whisper.cpp
src/ggml.c

index b50c86d057fc207a213e678393312d299ac6a7de..3192fbc640425b7d2714cc587971cb45e1d7e34c 100644 (file)
@@ -3,7 +3,7 @@
 #include "coreml/whisper-encoder.h"
 #endif
 
-#if WHISPER_USE_OPENVINO
+#ifdef WHISPER_USE_OPENVINO
 #include "openvino/whisper-openvino-encoder.h"
 #endif
 
@@ -731,7 +731,13 @@ static void whisper_default_log(const char * text) {
 
 static whisper_log_callback whisper_log = whisper_default_log;
 
-// TODO: fix compile warning about "format string is not a string literal"
+#ifdef __GNUC__
+#ifdef __MINGW32__
+__attribute__((gnu_format(printf, 1, 2)))
+#else
+__attribute__((format(printf, 1, 2)))
+#endif
+#endif
 static void log(const char * fmt, ...) {
     if (!whisper_log) return;
     char buf[1024];
@@ -2445,7 +2451,7 @@ static void fft(const std::vector<float> & in, std::vector<float> & out) {
 }
 
 static bool hann_window(int length, bool periodic, std::vector<float> & output) {
-    if (output.size() < length) {
+    if (output.size() < static_cast<size_t>(length)) {
         output.resize(length);
     }
     int offset = -1;
index 7c2b64dca04b65d98f8430222a7277e6d57ef856..63a22223a4a003699527f813a617d3328bef9c17 100644 (file)
@@ -298,12 +298,14 @@ typedef double ggml_float;
 #if defined(_MSC_VER) || defined(__MINGW32__)
 #include <intrin.h>
 #else
+#if defined(__AVX__) || defined(__AVX2__) || defined(__AVX512F__) || defined(__SSSE3__) || defined(__SSE3__)
 #if !defined(__riscv)
 #include <immintrin.h>
 #endif
 #endif
 #endif
 #endif
+#endif
 
 #ifdef __riscv_v_intrinsic
 #include <riscv_vector.h>