Skip to content

Help with grammars, beginner #11464

Answered by ggerganov
MichaelWkTran asked this question in Q&A
Discussion options

You must be logged in to vote

Try to put the grammar at the start of the chain.

Also, in general you need to accept all tokens from the prompt by calling the llama_sampler_accept() function for each token. This will initialize the state of the grammar sampler with the prompt. Probably not needed for this particular case, but still better to do it.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@MichaelWkTran
Comment options

@ggerganov
Comment options

@MichaelWkTran
Comment options

Answer selected by MichaelWkTran
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants