Fix non_streaming_server.py crash with --decoding-method modified_beam_search - #3819
Conversation
check_args() referenced args.num_active_paths, but this script defines the flag as --max-active-paths (and consumes args.max_active_paths), so --decoding-method modified_beam_search crashed with AttributeError at startup.
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughCorrects ChangesModified beam search validation
Estimated code review effort: 1 (Trivial) | ~2 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
csukuangfj
left a comment
There was a problem hiding this comment.
Thank you for your contribution!
python-api-examples/non_streaming_server.pydefines the flag as--max-active-paths(line 434) and consumesargs.max_active_paths(line 970), butcheck_args()asserts onargs.num_active_paths, which this script never defines. Starting the server with--decoding-method modified_beam_search(or with--hotwords-file, whichcheck_argsgates behind it) has always crashed at startup:The gap dates to b094868 (#259), which adapted
streaming_server.py(where the flag is consistently--num-active-paths) but renamed the flag without updatingcheck_args. This alignscheck_argswith the name the script already defines and consumes, keeping the CLI unchanged; the greedy_search path is untouched.Tested with
sherpa-onnx-zipformer-en-2023-04-01: on master the command above crashes as shown; with this change the same command loads the model and binds the port (server listening on 0.0.0.0:16125). A greedy_search control starts cleanly before and after. Hit this while running the server locally for transcription and switching the decoding method.Summary by CodeRabbit