Spaces:
Running
Running
Print system info at start of program
Browse files- examples/bench/bench.cpp +5 -3
- examples/main/main.cpp +6 -3
examples/bench/bench.cpp
CHANGED
|
@@ -56,6 +56,11 @@ int main(int argc, char ** argv) {
|
|
| 56 |
|
| 57 |
struct whisper_context * ctx = whisper_init(params.model.c_str());
|
| 58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
if (ctx == nullptr) {
|
| 60 |
fprintf(stderr, "error: failed to initialize whisper context\n");
|
| 61 |
return 2;
|
|
@@ -74,9 +79,6 @@ int main(int argc, char ** argv) {
|
|
| 74 |
whisper_print_timings(ctx);
|
| 75 |
whisper_free(ctx);
|
| 76 |
|
| 77 |
-
fprintf(stderr, "\n");
|
| 78 |
-
fprintf(stderr, "system_info: n_threads = %d / %d | %s\n", params.n_threads, std::thread::hardware_concurrency(), whisper_print_system_info());
|
| 79 |
-
|
| 80 |
fprintf(stderr, "\n");
|
| 81 |
fprintf(stderr, "If you wish, you can submit these results here:\n");
|
| 82 |
fprintf(stderr, "\n");
|
|
|
|
| 56 |
|
| 57 |
struct whisper_context * ctx = whisper_init(params.model.c_str());
|
| 58 |
|
| 59 |
+
{
|
| 60 |
+
fprintf(stderr, "\n");
|
| 61 |
+
fprintf(stderr, "system_info: n_threads = %d / %d | %s\n", params.n_threads, std::thread::hardware_concurrency(), whisper_print_system_info());
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
if (ctx == nullptr) {
|
| 65 |
fprintf(stderr, "error: failed to initialize whisper context\n");
|
| 66 |
return 2;
|
|
|
|
| 79 |
whisper_print_timings(ctx);
|
| 80 |
whisper_free(ctx);
|
| 81 |
|
|
|
|
|
|
|
|
|
|
| 82 |
fprintf(stderr, "\n");
|
| 83 |
fprintf(stderr, "If you wish, you can submit these results here:\n");
|
| 84 |
fprintf(stderr, "\n");
|
examples/main/main.cpp
CHANGED
|
@@ -343,6 +343,12 @@ int main(int argc, char ** argv) {
|
|
| 343 |
}
|
| 344 |
}
|
| 345 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 346 |
// print some info about the processing
|
| 347 |
{
|
| 348 |
fprintf(stderr, "\n");
|
|
@@ -412,8 +418,5 @@ int main(int argc, char ** argv) {
|
|
| 412 |
whisper_print_timings(ctx);
|
| 413 |
whisper_free(ctx);
|
| 414 |
|
| 415 |
-
fprintf(stderr, "\n");
|
| 416 |
-
fprintf(stderr, "system_info: n_threads = %d / %d | %s\n", params.n_threads, std::thread::hardware_concurrency(), whisper_print_system_info());
|
| 417 |
-
|
| 418 |
return 0;
|
| 419 |
}
|
|
|
|
| 343 |
}
|
| 344 |
}
|
| 345 |
|
| 346 |
+
// print system information
|
| 347 |
+
{
|
| 348 |
+
fprintf(stderr, "\n");
|
| 349 |
+
fprintf(stderr, "system_info: n_threads = %d / %d | %s\n", params.n_threads, std::thread::hardware_concurrency(), whisper_print_system_info());
|
| 350 |
+
}
|
| 351 |
+
|
| 352 |
// print some info about the processing
|
| 353 |
{
|
| 354 |
fprintf(stderr, "\n");
|
|
|
|
| 418 |
whisper_print_timings(ctx);
|
| 419 |
whisper_free(ctx);
|
| 420 |
|
|
|
|
|
|
|
|
|
|
| 421 |
return 0;
|
| 422 |
}
|