Skip to content

llama : fix grammar sometimes generating null char - #2756

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

ggerganov merged 1 commit into
ggml-org:masterfrom
ejones:grammar-fix-nul

Conversation

@ejones

@ejones ejones commented Aug 24, 2023

Copy link
Copy Markdown
Collaborator

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
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
phuongncn pushed a commit to phuongncn/llama.cpp-gx10-dgx-sparks-deepseekv4 that referenced this pull request Apr 28, 2026
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
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