[Lane 2 · kotlin-core] tokenizer.json parity — match non-special added_tokens atomically and count them in vocabSize
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 72/100
Hướng nghiên cứu
Read the added-token loop in QwenByteLevelBpeTokenizer.kt and TokenizerFactory.kt, then inspect the related tests in TokenizerFactoryDispatchTest.kt. Add a synthetic case where a non-special token would otherwise split, and check that it encodes atomically and vocabSize includes its id. Run ./gradlew :skainet-io:skainet-io-core:jvmTest; done means the test passes and the changelog records the vocabSize change.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Sub-issue of #1321 (HF tokenizer.json parity for BPE encoders).
Lane: 2 · Kotlin core
Skill needed: Kotlin. Helpful to have read how tokenizers matches added tokens (one page of docs, linked below). No tensor knowledge.
Size: s (a few hours)
Blocked by: nothing (independent of the merges lane; both touch the same file, so rebase once)
What to do
- Read how the reference matches added tokens: every entry of
added_tokensis matched atomically, before pre-tokenization, regardless ofspecial. Thespecialflag only decides whether the token is dropped bydecode(skip_special_tokens=True). See theAddedVocabularysection of thetokenizersdocs: https://huggingface.co/docs/tokenizers/api/added-tokens - In QwenByteLevelBpeTokenizer.kt#L257-L267 the loop skips entries with
"special": false. Register all entries in the atomic-match map. Keep a separateSet<Int>of the ids that are marked special so a later change can implementskip_special_tokens; nothing else needs that set today. - Make the same change in TokenizerFactory.kt#L155-L169 for the Unigram path (
wrapSentencePieceWithSpecialsFromJson). - Added tokens may have ids above
model.vocab(ModernBERT:[UNK]=50280 … and the whitespace runs up to 50367). Extend thetokensarray sovocabSizeequals the referenceget_vocab_size(with_added_tokens=True)— 50368 for ModernBERT instead of today's 50280 — and sodecodecan return their text. - Tests, in
TokenizerFactoryDispatchTest.kt: a synthetic file with onespecial: falseadded token whose content would otherwise BPE-split; assert it encodes to its id and thatvocabSizecounts it. Run./gradlew :skainet-io:skainet-io-core:jvmTest.
Acceptance
- Synthetic test: non-special added token encodes atomically;
vocabSizeincludes ids abovemodel.vocab - With the ModernBERT file (tokenizer/tokenizer.json) and merges loading (sibling lane),
" leading"encodes to[50275, 16378](reference:[' ', 'leading']) instead of[245, 4283, …], andvocabSize == 50368 -
CHANGELOG.mdnotes thevocabSizebehaviour change - Result reported back on #1321
Notes
The flags single_word, lstrip, rstrip, normalized exist on every entry. In the two Laya files they are all false except normalized: true on the non-special ModernBERT entries (and lstrip: true on one special token). Implement plain longest-match as the existing special-token code does; if a file you care about sets single_word or lstrip/rstrip, open a separate issue rather than growing this one. #912 asks for the same vocabSize fix on the SentencePiece side — closing that part here is fine, say so in the PR.
- Ngôn ngữ chính
- Kotlin
- Star
- 52
- Fork
- 15
- Merge trung bình
- 1 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 37
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của SKaiNET-developers/SKaiNET
-
coding good first issue platform size:xs skill:js sub-issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
SKaiNET-developers/SKaiNET#1232 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
compute-backend dsl/api enhancement size:m skill:kotlin-core skill:numerics
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 18/100
SKaiNET-developers/SKaiNET#1343 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
compute-backend dsl/api enhancement size:m skill:kotlin-core skill:numerics
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
SKaiNET-developers/SKaiNET#1342 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
skeep tracking
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
SKaiNET-developers/SKaiNET#1331 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
assessment size:s skill:review sub-issue
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 18/100
SKaiNET-developers/SKaiNET#1330 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của SKaiNET-developers/SKaiNET
Issue tương tự
-
afk-ok area:data-quality importer size:S
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
enorm-labs/event-junkie#3301 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
MDM: interfaceName cannot be set through managed configurationsCó thể đã có người làm @JulienUsson đã nhận hôm nay. Đang mởbug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
bk138/droidVNC-NG#404 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
rustyrazorblade/easy-db-lab#1017 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
openclaw/openclaw#172218 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày