ml-explore / ml-explore/mlx-examples

Is there a way to implement a Timeout / cancellation for transcribe() method, espeicially model.decode()? (large-v3 sometimes stalls >200s on ~10s audio)

Open
#1,373 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
9k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

For certain short audio clips (~10 s), mlx-whisper (model: large-v3) spends an extremely long time inside model.decode() when called via whisper.transcribe(). In one case, I set a ~10 s application-level timeout, but logging shows the decode call continued for ~200 s before returning.

I’d like a way to cancel / time out decoding so my application can skip problematic audio and continue processing subsequent chunks.

Is there any recommended way to achieve this? Or would this require modifying the decoding loop itself?

Thank you

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the transcribe() call path into model.decode(), focusing on the decoding loop mentioned in the report. Determine how a timeout or cancellation should return control so processing can continue with later audio chunks, then verify that the stalled large-v3 case exits as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
audio-video-rtc, machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.