Repository navigation
docs(router): add routing guide - #461
Conversation
|
Thank you for a clear, accurate routing guide. I checked the precedence order, the examples and the loading and batching sections against router.py, and they hold up. One fix: an unrecognised hint does not abstain. Only |
#461's guide is accurate everywhere I checked it against laya/router.py, with one exception: it said an unrecognized hint does not force a checkpoint, and it does. Measured on the merged tree with Router().route("hello there my friend", lang_guess=...): None, '', ' ', 'C', 'POSIX', 'C.UTF-8', 'und', 'zxx', 'mul' -> english 'xx', False, 0, 'de' -> multilingual So the abstaining set falls through as the guide describes, but any other value is read as "not English" and picks multilingual. A reader passing a detector's garbage code expecting fallthrough would get the wrong checkpoint and the page told them they would not. The paragraph now separates the two cases and says to map a detector's unknown case to None if it matters. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Merged for 0.3.24, with one paragraph corrected on the way in. The guide holds up. I re-checked the precedence order, the examples, and the loading and batching sections against The one fix is the claim I raised in September, which had not been picked up, so I made it rather than hold the page any longer. Measured on the merged tree with So the abstaining set behaves as you described, but an unrecognized hint is not an abstention: any other value is read as "not English" and picks multilingual. The page said an unrecognized hint continues to the next rule, which would send a reader passing a detector's garbage code to the wrong checkpoint while believing they were safe. The paragraph now separates the two cases and says to map a detector's unknown case to One thing you did not need to do and I checked anyway:
|
What
Add a Router guide covering checkpoint selection, language overrides, custom language hints, explicit typed-decisions routing, inspection without model loading, checkpoint memory, and mixed batches.
Why
Issue #390 calls out a routing guide as one of the next documentation pages. The API reference documents the surface, but the practical choices and their order were spread across the README and docstrings.
How it was verified
uvx --from zensical==0.0.64 --with mkdocstrings-python==2.0.9 --with ruff==0.16.8 zensical build --strict --clean— passed with no issues.git diff --check— passed.Refs #390