Skip to content

prevent panic on paraformer engine init failure#36

Open
AdityaShome wants to merge 1 commit intomofa-org:mainfrom
AdityaShome:asr-engine-panic
Open

prevent panic on paraformer engine init failure#36
AdityaShome wants to merge 1 commit intomofa-org:mainfrom
AdityaShome:asr-engine-panic

Conversation

@AdityaShome
Copy link
Copy Markdown

Description

This PR fixes a critical bug where the dora-funasr-mlx node would panic and silently crash the entire voice chat dataflow if the Paraformer ASR engine failed to initialize (e.g., due to missing MLX models or out-of-memory errors).
Because Dora does not automatically restart nodes when they panic, this would cause the UI to remain stuck in the "running" state without any transcription ever arriving.
Fixes: #34

Changes Made

  • Replaced the panicking unwrap() on the lazily initialized engine at node-hub/dora-funasr-mlx/src/main.rs:103 with a safe match block.
  • Added a log::error! message and a send_log() Dora event to inform the user.
  • Used continue to safely skip the audio frame if the engine is unavailable, keeping the node alive so it doesn't crash the dataflow.

Testing

  • Code structurally verified to gracefully handle None.
  • cargo fmt passed cleanly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Panic on ASR engine initialization

1 participant