| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Upgrade outlines_core to 0.2.11 and update its logits processor/backend | 1 年前 | |
Fix coverage issues, improve testing logits processors | 1 年前 | |
Test the whitespace_pattern error on the llguidance and xgrammar backends The backends raise NotImplementedError when whitespace_pattern is set, but only the outlines_core backend had a test. Add a regression test for each so the unsupported whitespace path is exercised. | 1 个月前 | |
Fix the JsonSchema whitespace_pattern being ignored by the backend The whitespace_pattern set on a JsonSchema output type was not passed to the backend during generation, so it had no effect on the default outlines_core backend even though to_regex already honors it. Thread the whitespace_pattern through the backend interface and forward it to build_regex_from_schema. The llguidance and xgrammar backends raise NotImplementedError when a pattern is set, since they compile the schema with their own grammar engines and cannot apply it. | 1 个月前 | |
fix: raise clearly instead of asserting on a rejected XGrammar token XGrammarLogitsProcessor.process_logits used `assert self._matchers[i].accept_token(last_token_id)` to advance the grammar matcher's state after each generated token. Python's `-O`/ `PYTHONOPTIMIZE=1` mode strips all `assert` statements at compile time, so under that mode the matcher's state is silently never advanced past the first token: no error, no warning, and structured-output constraints (regex/JSON-schema/CFG) stop being enforced for the rest of generation. Replace the assert with an explicit check that raises RuntimeError, which -O cannot strip. Added a unit test constructing the processor with a mocked rejecting matcher, confirming a clear RuntimeError is raised. Verified it fails (AssertionError under normal mode, would silently no-op under -O) against the pre-fix code and passes after -- including re-running it under `python -O` directly to confirm the fix is optimization-safe. Ran the full tests/backends/test_xgrammar.py suite (4 passed, 1 skipped for non-Apple-Silicon) and pre-commit (mypy + ruff) clean. Disclosure: I used an AI coding assistant (Claude) to help identify this bug and draft the fix. I independently reproduced the AssertionError pre-fix, verified the fix under both normal and `-O` execution modes, and ran the full local backend test suite before opening this PR. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> | 1 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 1 年前 | ||
| 1 年前 | ||
| 1 个月前 | ||
| 1 个月前 | ||
| 1 个月前 |