Skip to content

Fix WebSocket JSON hotword routing with CI (preserves #3880) - #3892

Merged
LauraGPT merged 3 commits into
mainfrom
codex/pr3880-websocket-hotwords-ci-20261113
Nov 13, 2026
Merged

LauraGPT merged 3 commits into
mainfrom
codex/pr3880-websocket-hotwords-ci-20261113

Conversation

@LauraGPT

Copy link
Copy Markdown
Collaborator

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

  • Current integrated source: 40 selected CPU tests passed, zero skips/errors. The prior original-patch negative control (3 failures/2 passes) is preserved, not rerun.
  • Real Shanghai L20Z FP32: ws_serve coroutine -> 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.
  • The first private GPU harness failed before any cases because its local config lacked tokenizer_conf. That failure is retained; the corrected isolated fixture uses the same existing synthetic weights, inputs and literal expected values.
  • This validates protocol/model input and CUDA execution contracts, not pretrained ASR recognition quality, real network transport, arbitrary model compatibility, NPU, Nano or the full repository suite. No new pretrained weights downloaded.
  • Actual new-head/main CI checkout and artifact bytes must pass before completion. No self-approval, protection changes or admin bypass.

This server-script fix is not part of the separately versioned funasr-torch package.

tanishqbaweja and others added 3 commits November 12, 2026 17:01
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>
@LauraGPT
LauraGPT merged commit 03945d9 into main Nov 13, 2026
3 checks passed
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.

funasr_wss_server.py: hotwords in the websocket protocol's JSON format reach the model as <unk>

2 participants