]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
llama-bench : set locale to utf8 (#2832)
authorslaren <redacted>
Mon, 28 Aug 2023 17:19:18 +0000 (19:19 +0200)
committerGitHub <redacted>
Mon, 28 Aug 2023 17:19:18 +0000 (19:19 +0200)
examples/llama-bench/llama-bench.cpp

index d0fe6d90d3bbee09541b628758ff4f98f82f573d..bf3a487abd3054b0c5077474affc2391d68a1ff6 100755 (executable)
@@ -3,6 +3,9 @@
 #include <cassert>
 #include <chrono>
 #include <cinttypes>
+#include <clocale>
+#include <cmath>
+#include <cstdio>
 #include <cstring>
 #include <ctime>
 #include <iterator>
@@ -10,7 +13,6 @@
 #include <numeric>
 #include <regex>
 #include <sstream>
-#include <stdio.h>
 #include <string>
 #include <vector>
 
@@ -916,6 +918,9 @@ static void llama_null_log_callback(enum llama_log_level level, const char * tex
 }
 
 int main(int argc, char ** argv) {
+    // try to set locale for unicode characters in markdown
+    setlocale(LC_CTYPE, ".UTF-8");
+
 #if !defined(NDEBUG)
     fprintf(stderr, "warning: asserts enabled, performance may be affected\n");
 #endif