Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改动
词元是模型一次处理的文本单位。生成允许词元集合时,编译器会多次按词元首字节扫描已经排序的词表。本改动在编译器建立时一次性计算 256 个首字节各自对应的词表范围和最长后缀长度,后续所有语法共享这些只读结果,避免重复扫描。
本请求依赖 #722 提供的词元前缀批量处理与结果缓存。本分支中的前两个提交属于 #722;本请求需要审查的独立提交是
2a0ffedd。性能
结构标签是把触发文本、函数参数规则和结束文本组合起来的生成约束。JSON Schema 是描述 JSON 数据结构及字段约束的规则。允许词元集合生成时间是生成每一步筛选合法词元所需的平均时间。
四类输入的允许词元集合生成均有明确收益;编译时间变化均小于 1%。
正确性