Skip to content

test-llama-archs : generate dummy test vocab - #29084

Merged
ggerganov merged 1 commit into
masterfrom
gg/test-llama-archs-vocab
Sep 19, 2026
Merged

ggerganov merged 1 commit into
masterfrom
gg/test-llama-archs-vocab

Conversation

@ggerganov

@ggerganov ggerganov commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Overview

Adds a new dummy vocab type LLAMA_VOCAB_TYPE_TEST for testing generated dummy models.

The tokenizer is intentionally simple and deterministic:

  • text -> tokens: consume 5-character chunks, compute a rolling polynomial hash, and emit hash % n_vocab
  • tokens -> text: emit the token id as lowercase hex

tests/test-llama-archs.cpp now generates a test tokenizer for every dummy model it creates, so generated models can be used by examples/tests that require tokenizing text.

Additional information

  • Added LLAMA_VOCAB_TYPE_TEST to the public vocab enum.
  • Implemented encode/decode dispatch in src/llama-vocab.cpp.
  • src/llama-model-saver.cpp now skips writing null special-token IDs.

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES. pi:llama.cpp/DeepSeek-V4-Flash-Vision-Exp

Assisted-by: pi:llama.cpp/DeepSeek-V4-Flash-Vision-Exp
@github-actions github-actions Bot added the testing Everything test related label Sep 18, 2026
@ggerganov
ggerganov marked this pull request as ready for review September 18, 2026 15:11
@ggerganov
ggerganov requested a review from CISC as a code owner September 18, 2026 15:11
@ggerganov
ggerganov merged commit efa28e9 into master Sep 19, 2026
22 of 27 checks passed
@ggerganov
ggerganov deleted the gg/test-llama-archs-vocab branch September 19, 2026 08:27
LadislavSopko pushed a commit to 0ics-srls/llama.cpp that referenced this pull request Oct 5, 2026
Assisted-by: pi:llama.cpp/DeepSeek-V4-Flash-Vision-Exp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant