Skip to content

Model grammar support via BNF #59

@EricLBuehler

Description

@EricLBuehler

We will implement based on this.

The idea is as follows, given parsed BNF.

  1. While the model is calculating the logits, prepare the logit bias on a worker thread (from a pool).
  2. Run normal sampling first: if the returned token is valid grammar, avoid applying the logit bias
  3. During normal sampling, apply the logit bias on a worker thread (from a pool).
  4. If the normal sampling produced a token that would be invalid, rerun with the applied logit bias.

Metadata

Metadata

Assignees

No one assigned

    Labels

    new featureNew feature or requestprocessingProcessing related to the model

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions