]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
Print system info at start of program
authorGeorgi Gerganov <redacted>
Thu, 27 Oct 2022 14:22:10 +0000 (17:22 +0300)
committerGeorgi Gerganov <redacted>
Thu, 27 Oct 2022 14:22:19 +0000 (17:22 +0300)
examples/bench/bench.cpp
examples/main/main.cpp

index d87bf37a547663e317ea6934248a52be59c5eb39..7395a50e5c37423dd415768b74ab53b01297eb61 100644 (file)
@@ -56,6 +56,11 @@ int main(int argc, char ** argv) {
 
     struct whisper_context * ctx = whisper_init(params.model.c_str());
 
+    {
+        fprintf(stderr, "\n");
+        fprintf(stderr, "system_info: n_threads = %d / %d | %s\n", params.n_threads, std::thread::hardware_concurrency(), whisper_print_system_info());
+    }
+
     if (ctx == nullptr) {
         fprintf(stderr, "error: failed to initialize whisper context\n");
         return 2;
@@ -74,9 +79,6 @@ int main(int argc, char ** argv) {
     whisper_print_timings(ctx);
     whisper_free(ctx);
 
-    fprintf(stderr, "\n");
-    fprintf(stderr, "system_info: n_threads = %d / %d | %s\n", params.n_threads, std::thread::hardware_concurrency(), whisper_print_system_info());
-
     fprintf(stderr, "\n");
     fprintf(stderr, "If you wish, you can submit these results here:\n");
     fprintf(stderr, "\n");
index 0fe8efcfc82a10292f70e78104e6d1babaaf09a8..91e4a375522ee53b2a281141a3bca0b03eaf46ad 100644 (file)
@@ -343,6 +343,12 @@ int main(int argc, char ** argv) {
             }
         }
 
+        // print system information
+        {
+            fprintf(stderr, "\n");
+            fprintf(stderr, "system_info: n_threads = %d / %d | %s\n", params.n_threads, std::thread::hardware_concurrency(), whisper_print_system_info());
+        }
+
         // print some info about the processing
         {
             fprintf(stderr, "\n");
@@ -412,8 +418,5 @@ int main(int argc, char ** argv) {
     whisper_print_timings(ctx);
     whisper_free(ctx);
 
-    fprintf(stderr, "\n");
-    fprintf(stderr, "system_info: n_threads = %d / %d | %s\n", params.n_threads, std::thread::hardware_concurrency(), whisper_print_system_info());
-
     return 0;
 }