Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome on Android crashes when starting Whisper #740

Open
1 of 5 tasks
flatsiedatsie opened this issue May 7, 2024 · 3 comments
Open
1 of 5 tasks

Chrome on Android crashes when starting Whisper #740

flatsiedatsie opened this issue May 7, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@flatsiedatsie
Copy link

System Info

While it runs fine on desktop, it crashes on mobile.

Pixel 6A Android 14 (6gb ram)

Using Transformers.js V2 (the website is a mix of V2 and V3, but with this test no V3 things (e.g. musicgen) have loaded, running Whisper in a webworker.

The webworker is based on the AutomaticSpeechRecognitionPipelineFactory example.

The model being loaded is Xenova/whisper-base.en. Right before the crash I see the serviceworker confirm that it was downloaded and caching it.

Environment/Platform

  • Website/web-app
  • Browser extension
  • Server-side (e.g., Node.js, Deno, Bun)
  • Desktop app (e.g., Electron)
  • Other (e.g., VSCode extension)

Description

Chrome on Android crashed with an "Aw snap" screen. This happens consistently every time.

I managed to connect remote debugging and saw this:

Screenshot 2024-05-07 at 11 01 03

Some code from the worker:

let data = transcriber.tokenizer._decode_asr(chunks_to_process, {
    time_precision: time_precision,
    return_timestamps: true,
    force_full_sequences: false,
});

and

output = await transcriber(audio, {
     // Greedy
      top_k: 0,
     do_sample: false,

     / Sliding window
     chunk_length_s: isDistilWhisper ? 20 : 30,
     stride_length_s: isDistilWhisper ? 3 : 5,

     // Language and task
     language: language,
     task: subtask,

     // Return timestamps
     return_timestamps: true,
     orce_full_sequences: false,

     // Callback functions
     callback_function: callback_function, // after each generation step
     chunk_callback: chunk_callback, // after each chunk is processed
})

Reproduction

I will email you a link so you can try it yourself.

I will also try to create a lower resource version and see if I can find out more.

@flatsiedatsie flatsiedatsie added the bug Something isn't working label May 7, 2024
@flatsiedatsie
Copy link
Author

I tested the official whisper example with the same settings, and get the same result. It must be a memory issue, as running the example on the phone withtiny and quant enabled does work.

@flatsiedatsie
Copy link
Author

Hmm, still getting errors, even when using tiny+quantization:

whisper_tjs

@flatsiedatsie flatsiedatsie reopened this May 7, 2024
@flatsiedatsie
Copy link
Author

Funny, when searching for the error code the first result is for Transformers.js, and whisper.

#54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant