You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Transformer.js 3.5.1 , after "transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-base');"
Chrome 132.0.6834.165 , realme Q3, 6G+128G. it will fail with "Can't create a session.failded to allocate a buffer of size 23200850"
Chrome 132.0.6834.123 , Samsung S20+ ,8G+64G, it works ok.
Chrome 136.0.7103.87 , PH-1 , 3G+128G, it works ok.
I make a memory tester - for 1, It only allocate about 300-500MB. for 2,3 ,it can allocate about 4GB.
function testMaxMemory() {
let pages =100; // 62.5MB
try {
while (true) {
const memory = new WebAssembly.Memory({ initial: pages, maximum: pages });
console.log( ${pages * 65536 / (1024 * 1024)} MB);
pages += 100;
}
} catch (e) {
console.error( ${e.message});
console.log( ${(pages - 100) * 65536 / (1024 * 1024)} MB);
}
}
After searching online, I believe that this problem is related to the memory allocation of Android to WASM, but there is currently a lack of a solution, which makes it impossible to reliably deploy Transformers.js on mobile phones.
I have faced a similar issue. I tried loading tiny and base on an android device with 8GB LPDDR4X, both loads but goes OOM pretty quick after a few seconds of transcription.
@rockmany2000 Latest stable Chrome and chromium-based Samsung Internet Browser from Play Store only allocates at most 1026MB for me. How did you get to 4GB? Are you using a modified build of chromium?
System Info
Transformer.js 3.5.1 , Chrome in Android Phone
Environment/Platform
Description
Transformer.js 3.5.1 , after "transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-base');"
I make a memory tester - for 1, It only allocate about 300-500MB. for 2,3 ,it can allocate about 4GB.
function testMaxMemory() {
let pages =100; // 62.5MB
try {
while (true) {
const memory = new WebAssembly.Memory({ initial: pages, maximum: pages });
console.log(
${pages * 65536 / (1024 * 1024)} MB
);pages += 100;
}
} catch (e) {
console.error(
${e.message}
);console.log(
${(pages - 100) * 65536 / (1024 * 1024)} MB
);}
}
After searching online, I believe that this problem is related to the memory allocation of Android to WASM, but there is currently a lack of a solution, which makes it impossible to reliably deploy Transformers.js on mobile phones.
WebAssembly/design#1397
Reproduction
transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-base');
The text was updated successfully, but these errors were encountered: