Skip to content

Commit 78008c7

Browse files
danbevlinxiaodong
authored andcommitted
examples : fix nthread parsing in whisper.wasm (ggml-org#2938)
This commit fixes the nthread parsing in the whisper.wasm example when using the `Threads` slider to change the number of threads to be used. Currently this results in the following error: ```console main.js:5597 Uncaught TypeError: Cannot convert "5" to int at checkAssertions (main.js:5597:21) at Object.toWireType (main.js:5611:15) at Object.full_default (eval at new_ (main.js:5292:27), <anonymous>:10:26) at whisper.wasm/:649:42 ```
1 parent e12a82e commit 78008c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/whisper.wasm/index-tmpl.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@
614614
var nthreads = 8;
615615

616616
function changeThreads(value) {
617-
nthreads = value;
617+
nthreads = parseInt(value, 10);
618618
document.getElementById('threads-value').innerHTML = nthreads;
619619
}
620620

0 commit comments

Comments
 (0)