whisper.wasm : update system info print

pull/114/head
Georgi Gerganov 2 years ago
parent 234f414652
commit 12fb303d9d
No known key found for this signature in database
GPG Key ID: 449E073F9DC10735

@ -46,8 +46,6 @@ EMSCRIPTEN_BINDINGS(whisper) {
struct whisper_full_params params = whisper_full_default_params(whisper_sampling_strategy::WHISPER_SAMPLING_GREEDY);
printf("full_default: available threads %d\n", std::thread::hardware_concurrency());
params.print_realtime = true;
params.print_progress = false;
params.print_timestamps = true;
@ -57,9 +55,6 @@ EMSCRIPTEN_BINDINGS(whisper) {
params.n_threads = std::min(8, (int) std::thread::hardware_concurrency());
params.offset_ms = 0;
printf("full_default: using %d threads\n", params.n_threads);
printf("full_default: language '%s'\n", params.language);
std::vector<float> pcmf32;
const int n = audio["length"].as<int>();
@ -71,6 +66,20 @@ EMSCRIPTEN_BINDINGS(whisper) {
emscripten::val memoryView = audio["constructor"].new_(memory, reinterpret_cast<uintptr_t>(pcmf32.data()), n);
memoryView.call<void>("set", audio);
// print system information
{
printf("system_info: n_threads = %d / %d | %s\n",
params.n_threads, std::thread::hardware_concurrency(), whisper_print_system_info());
printf("%s: processing %d samples, %.1f sec, %d threads, %d processors, lang = %s, task = %s ...\n",
__func__, int(pcmf32.size()), float(pcmf32.size())/WHISPER_SAMPLE_RATE,
params.n_threads, 1,
params.language,
params.translate ? "translate" : "transcribe");
printf("\n");
}
int ret = whisper_full(g_contexts[index], params, pcmf32.data(), pcmf32.size());
whisper_print_timings(g_contexts[index]);

File diff suppressed because one or more lines are too long

@ -469,7 +469,6 @@
printTextarea('js: processing - this might take a while ...');
printTextarea('js: the page will be unresponsive until the processing is completed');
printTextarea('');
printTextarea('');
setTimeout(function() {
var ret = Module.full_default(instance, audio, document.getElementById('language').value, translate);

Loading…
Cancel
Save