mirror of
https://github.com/SillyTavern/Extension-Speech-Recognition.git
synced 2026-10-15 13:32:06 +00:00
[GH-ISSUE #20] [BUG] SillyTavern Speech Recognition Crashes with Local Xenova/whisper-medium (and larger) Models #8
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
SillyTavern/Extension-Speech-Recognition#8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @myxvcx on GitHub (Jun 20, 2025).
Original GitHub issue: https://github.com/SillyTavern/Extension-Speech-Recognition/issues/20
As i really have no idea i asked AI to write this for me, but to note is that the Speech Recognition crashes with it then again working on smaller models. i would never have the nerves for that formatting. please help me still.
GitHub Issue Draft for SillyTavern
Title: SillyTavern Crashes with Local
Xenova/whisper-medium(and larger) Models Due to Audio Handling in Node.jsBody:
Describe the bug
When using the local Speech Recognition feature in SillyTavern (version
[Your SillyTavern Version, e.g., 1.13.0]) withtransformers.jsand selecting a larger Whisper model likeXenova/whisper-medium.en(orXenova/whisper-medium), the SillyTavern server process crashes (the console window running the server disappears or closes abruptly). This makes it impossible to use larger local Whisper models.The
Xenova/whisper-smallmodel appears to work, or at least doesn't cause a fatal crash, though it may be encountering the same underlying issue less severely.To Reproduce
Steps to reproduce the behavior:
transformers.js.Xenova/whisper-medium.en(orXenova/whisper-medium).Expected behavior
SillyTavern should be able to use
Xenova/whisper-medium.en(and other sizes) for local speech recognition without crashing, similar to howXenova/whisper-smallfunctions.Screenshots / Logs
mediummodel.whisper-medium(dada.txt) only showed ONNX Runtime warnings which are normal.whisper-smallworking in SillyTavern (dsa.txt) also showed normal ONNX Runtime warnings.Standalone Test and Root Cause Identification
To investigate, I ran
Xenova/whisper-medium.enin a standalone Node.js script using@xenova/transformers.pipeline()function, the script failed with:By modifying the script to manually load the audio file, decode it to a 16kHz mono
Float32Array, and pass this buffer directly to thepipeline(),Xenova/whisper-medium.enworks perfectly on my system:This strongly suggests that SillyTavern's Speech Recognition extension is currently passing audio file paths directly to
transformers.jsin its Node.js environment. This is incompatible with howtransformers.jshandles audio file paths outside of a browser (which relies onAudioContext). The resulting error is likely causing the Node.js process to crash, especially with the higher resource demands of larger models likewhisper-medium.Working Standalone Node.js Script:
Here is the script that successfully runs
Xenova/whisper-medium.enon both CPU and GPU by pre-processing the audio:Suggested Fix:
The Speech Recognition extension (or the relevant part of SillyTavern handling local
transformers.jsASR) needs to be updated to handle audio input correctly for Node.js environments. This involves:Float32Array.transformers.jspipeline, instead of a file path.The official
transformers.jsdocumentation provides guidance on this:https://huggingface.co/docs/transformers.js/guides/node-audio-processing
Desktop (please complete the following information):
1.13.0 'release' (f12c523fc)transformers.jslocally)Extension Version 1.1.0 (main-83c38e5)Thank you for looking into this! Proper audio handling should allow for stable use of larger local Whisper models.
here a bit of context for finding it out
https://drive.google.com/file/d/15zgVrat9k5rMfz8r6XMGMEZ1e22QWZ57/view?usp=sharing, https://drive.google.com/file/d/1LatL1YGptgwj4D7O3NZRGYOMS4fyX3iv/view?usp=sharing, https://drive.google.com/file/d/1RC48CTlqP-RXf-LnZTzw50PP_h6xRMEQ/view?usp=sharing, https://drive.google.com/file/d/1l6B6eqVI7ummen8poPTxeo-lVpaJ1wH1/view?usp=sharing, https://drive.google.com/file/d/1msWPBRwsfEWoeExEkGfAHyX2faZu2G9v/view?usp=sharing, https://drive.google.com/file/d/1pBXZdnz1eHTDpu_BzGNtAgtLL-flNMl6/view?usp=sharing, https://drive.google.com/file/d/1pMzm7xHicteHePCo001bLZHBDDoT7Y-1/view?usp=sharing, https://aistudio.google.com/app/prompts?state=%7B%22ids%22:%5B%221vxAuZZw9kOVHRHekB2EBR_kt4lTfVA-A%22%5D,%22action%22:%22open%22,%22userId%22:%22103431721723232481461%22,%22resourceKeys%22:%7B%7D%7D&usp=sharing
@myxvcx commented on GitHub (Jun 22, 2025):