Repository navigation
Fix WebSocket JSON hotword routing with CI (preserves #3880) - #3892
Merged
Merged
Conversation
The websocket protocol sends hotwords as a JSON object string that maps each hotword to a weight, and the HTML5, Java, Android and C++ clients and the microphone mode of funasr_wss_client.py send that format. funasr_wss_server.py passed the string to AutoModel unchanged. AutoModel splits a hotword string on whitespace, so the JSON text became <unk> hotwords and the client hotwords had no effect. Keep the words of a JSON object and join them with spaces, as the C++ server does for NN hotwords. Other strings are passed on unchanged.
Preserve original #3880 author ancestry and patch. Carry forward current main without rewriting history; include hotword regressions and real test dependencies. Signed-off-by: LauraGPT <zhifu.gzf@alibaba-inc.com>
…d/add conflict Keep the complete previously tested current-main tree and original author ancestry. The final three-file delta is unchanged: 40 CPU tests and 15 real CUDA synthetic routing cases passed. Signed-off-by: LauraGPT <zhifu.gzf@alibaba-inc.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Integrate #3880 on current main, preserving its original author commit and hotword normalization. Fixes #3879. Weighted JSON object strings now reach the Python WebSocket model as words; AutoModel does not accept numeric hotword weights, so values remain intentionally omitted. Plain strings and other non-object values are unchanged. The already-merged offline model-selection change is retained.
Extend the existing Python 3.10/3.11/3.12 WebSocket workflow to execute hotword tests with actual scipy/websockets/CPU torch dependencies. No skipped-test acceptance.
Validation
ws_servecoroutine -> real source AutoModel/local state loading -> native Seaco and Contextual hotword tokenization -> CUDA kernels. Fifteen combinations of offline/online/2pass and five hotword formats, with two distinct synthetic PCM inputs; baseline nine failures/six passes, candidate fifteen passes. Raw outputs and CUDA traces retained.tokenizer_conf. That failure is retained; the corrected isolated fixture uses the same existing synthetic weights, inputs and literal expected values.This server-script fix is not part of the separately versioned funasr-torch package.