ggerganov commited on
Commit
b37dcf1
·
unverified ·
1 Parent(s): d2b4741

whisper.wasm : update system info print

Browse files
bindings/javascript/emscripten.cpp CHANGED
@@ -46,8 +46,6 @@ EMSCRIPTEN_BINDINGS(whisper) {
46
 
47
  struct whisper_full_params params = whisper_full_default_params(whisper_sampling_strategy::WHISPER_SAMPLING_GREEDY);
48
 
49
- printf("full_default: available threads %d\n", std::thread::hardware_concurrency());
50
-
51
  params.print_realtime = true;
52
  params.print_progress = false;
53
  params.print_timestamps = true;
@@ -57,9 +55,6 @@ EMSCRIPTEN_BINDINGS(whisper) {
57
  params.n_threads = std::min(8, (int) std::thread::hardware_concurrency());
58
  params.offset_ms = 0;
59
 
60
- printf("full_default: using %d threads\n", params.n_threads);
61
- printf("full_default: language '%s'\n", params.language);
62
-
63
  std::vector<float> pcmf32;
64
  const int n = audio["length"].as<int>();
65
 
@@ -71,6 +66,20 @@ EMSCRIPTEN_BINDINGS(whisper) {
71
  emscripten::val memoryView = audio["constructor"].new_(memory, reinterpret_cast<uintptr_t>(pcmf32.data()), n);
72
  memoryView.call<void>("set", audio);
73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  int ret = whisper_full(g_contexts[index], params, pcmf32.data(), pcmf32.size());
75
 
76
  whisper_print_timings(g_contexts[index]);
 
46
 
47
  struct whisper_full_params params = whisper_full_default_params(whisper_sampling_strategy::WHISPER_SAMPLING_GREEDY);
48
 
 
 
49
  params.print_realtime = true;
50
  params.print_progress = false;
51
  params.print_timestamps = true;
 
55
  params.n_threads = std::min(8, (int) std::thread::hardware_concurrency());
56
  params.offset_ms = 0;
57
 
 
 
 
58
  std::vector<float> pcmf32;
59
  const int n = audio["length"].as<int>();
60
 
 
66
  emscripten::val memoryView = audio["constructor"].new_(memory, reinterpret_cast<uintptr_t>(pcmf32.data()), n);
67
  memoryView.call<void>("set", audio);
68
 
69
+ // print system information
70
+ {
71
+ printf("system_info: n_threads = %d / %d | %s\n",
72
+ params.n_threads, std::thread::hardware_concurrency(), whisper_print_system_info());
73
+
74
+ printf("%s: processing %d samples, %.1f sec, %d threads, %d processors, lang = %s, task = %s ...\n",
75
+ __func__, int(pcmf32.size()), float(pcmf32.size())/WHISPER_SAMPLE_RATE,
76
+ params.n_threads, 1,
77
+ params.language,
78
+ params.translate ? "translate" : "transcribe");
79
+
80
+ printf("\n");
81
+ }
82
+
83
  int ret = whisper_full(g_contexts[index], params, pcmf32.data(), pcmf32.size());
84
 
85
  whisper_print_timings(g_contexts[index]);
bindings/javascript/whisper.js CHANGED
The diff for this file is too large to render. See raw diff
 
examples/whisper.wasm/index-tmpl.html CHANGED
@@ -469,7 +469,6 @@
469
  printTextarea('js: processing - this might take a while ...');
470
  printTextarea('js: the page will be unresponsive until the processing is completed');
471
  printTextarea('');
472
- printTextarea('');
473
 
474
  setTimeout(function() {
475
  var ret = Module.full_default(instance, audio, document.getElementById('language').value, translate);
 
469
  printTextarea('js: processing - this might take a while ...');
470
  printTextarea('js: the page will be unresponsive until the processing is completed');
471
  printTextarea('');
 
472
 
473
  setTimeout(function() {
474
  var ret = Module.full_default(instance, audio, document.getElementById('language').value, translate);