Skip to content

llama : fix grammar sometimes generating null char#2756

Merged
ggerganov merged 1 commit intoggml-org:masterfrom
ejones:grammar-fix-nul
Aug 24, 2023
Merged

llama : fix grammar sometimes generating null char#2756
ggerganov merged 1 commit intoggml-org:masterfrom
ejones:grammar-fix-nul

Conversation

@ejones
Copy link
Collaborator

@ejones ejones commented Aug 24, 2023

Inference with a grammar was sometimes generating null characters, effectively causing the output to hang. Probably introduced in #2553. It turns out llama_sample_grammar wasn't accounting for the '\0' token. This patch fixes the issue by rejecting that token unconditionally, treating it the same way as empty tokens.

@ggerganov ggerganov merged commit 6e91a1b into ggml-org:master Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants