mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1963] [CLOSED] setup: --draft-vocab latin ships a draft subset for accented Latin-script answers #3778
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3778
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/1963
Author: @ANBAL534
Created: 10/11/2026
Status: ❌ Closed
Base:
main← Head:draft-vocab-latin📝 Commits (5)
b7c505badd Latin MTP draft vocabulary24a42cfMerge remote-tracking branch 'upstream/main' into draft-vocab-latindb1dee6setup: select Latin draft vocabulary with --add7275e4cMerge remote-tracking branch 'upstream/main' into draft-vocab-latin03ab846Merge branch 'main' into draft-vocab-latin📊 Changes
6 files changed (+130 additions, -19 deletions)
View changed files
➕
data/draft_vocab_latin.bin(+0 -0)📝
docs/DETAILS.md(+5 -0)📝
setup.py(+8 -5)📝
tools/draft_vocab.py(+59 -11)➕
tools/test_draft_vocab_latin.py(+45 -0)📝
tools/test_setup_draft_vocab.py(+13 -3)📄 Description
The draft layer proposes tokens from a subset (rt/draft_vocab.bin), so a token outside that subset can never be drafted. The shipped English/code subset (--draft-vocab en, 40,525 ids) holds 37,803 of the vocabulary's 138,517 Latin tokens, and 27 Han / 71 kana / 36 hangul / 34 cjk_punct / 142 Cyrillic ones - the shape #137 fixed for CJK and #597 for French. A Latin-script answer that leans on accents and diacritics (Spanish, French, German, Portuguese, Italian, Polish, Czech, Romanian, Turkish, Vietnamese) has its words in the subset and most of its accented pieces outside it.
--draft-vocab latin ships a subset for those languages: the English/code base with its dedicated non-Latin tokens removed and every non-ASCII Latin token of the vocabulary added - 54,262 ids. It is built with tools/draft_vocab.py --add latin, the same selector the Cyrillic subset uses, so anyone can rebuild it from the GGUF.
TL;DR
What changes
Why it helps
Accented words get drafted. The subset carries 51,905 Latin tokens against the base's 37,803, and gives up the 310 dedicated non-Latin tokens the base held (27 Han, 71 kana, 36 hangul, 34 cjk_punct, 142 Cyrillic). A café, a StraÃe, a żółć answer has its own tokens in the draft head instead of being spelled out of byte fragments.
Cheaper than the default it replaces. 178 MiB of draft-head VRAM on IQ3_S against the cjk default's 348, for a PC that answers in a Latin-script language and does not need Han at all.
Rebuildable, not a blob. The file comes out of one command, so a user with a language the subset misses can rebuild it, and the shipped one can be checked against the GGUF:
python tools/draft_vocab.py --gguf -00001-of-0000N.gguf --base data/draft_vocab_en.bin --add latin --out data/draft_vocab_latin.bin
The subsets today
The ids column is each shipped file's size in int32 ids; the MiB column is setup.py's DRAFT_VOCAB_MIB, measured on IQ3_S, the largest.
Testing
Scope
Only the draft head reads this file. The main model answers in any language: a token outside the subset is written normally, it is simply never drafted. A later --draft-vocab cjk|en|cyrillic|fr replaces the file as it does for the other shipped subsets, and a subset made by hand is kept. Cyrillic, CJK, Greek and Arabic answers draft less than with their own subset, with the base's byte fragments as the fallback - the same trade --draft-vocab en already makes, in exchange for the accented Latin tokens.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.