fix(nemo/qnn/parakeet-ctc): wrapper.py raises NameError on undefined feat_dim - #3937
Conversation
main() printed and used feat_dim without defining it, so running the script always raised NameError before exporting anything. The sibling scripts/nemo/qnn/nemotron-3.5-asr-streaming-0.6b/wrapper.py reads it from asr_model.cfg.preprocessor.features; do the same here.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe ONNX export wrapper now reads the model’s configured preprocessor feature dimension before constructing the random input tensor. ChangesONNX export input configuration
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to The export wrapper now obtains the configured feature dimension before creating its input tensor, preventing the prior NameError and allowing ONNX export to proceed. No current merge-blocking risk is identified. 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 |
scripts/nemo/qnn/parakeet-ctc/wrapper.pyusesfeat_dimwithout ever binding it:Those are the only two undefined names in the file, and they sit on the straight-line path of
main(), sopython wrapper.py --max-len ... --model-id ...always dies right after downloadingand printing the model — before it exports anything.
The sibling script one directory over,
scripts/nemo/qnn/nemotron-3.5-asr-streaming-0.6b/wrapper.py:370, has the line this one ismissing:
(
scripts/nemo/nemotron-3.5-asr-streaming-0.6b/export_onnx.py:186does the same.)Reproduction
NeMo is not needed to show it —
mainis lifted out of the file withastand run against astub whose
cfgbehaves like the OmegaConf config NeMo returns(
preprocessor.features = 128), withtorch.onnx.exportcaptured:(1, 128, 200)is(N, C, T)as documented inModelWrapper.forward.Fix
Add the missing
feat_dim = asr_model.cfg.preprocessor.features, matching the sibling wrapper.🤖 Generated with Claude Code
Summary by CodeRabbit