[Bug]: TransformersTokenizer vocabulary queries raise NotImplementedError
Maintainers usually reply within 1 day
@JunkaiWang-TheoPhy is already working on this.
Since Dec 2, 2026.
- #23254 by @JunkaiWang-TheoPhy — open
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
Research direction
Find the TransformersTokenizer implementation and its tests in the TensorRT-LLM repository; the issue does not name their paths. Read how the wrapper delegates encoding and get_added_vocab(), then compare its vocabulary methods with the underlying Transformers tokenizer. Done when the three reproduction assertions pass; linked pull request #23254 is already open.
Written by the indexing model from the issue text.
Description
System Info
TensorRT-LLM main ef375f87565b89a5818e705c735ec59a182efb86. Reproduced on Python 3.12/macOS ARM64 with Hugging Face Transformers and an in-memory Rust-backed WordLevel tokenizer. No GPU, model weights, or network is needed for the example. Native TensorRT startup was bypassed in the local CPU harness.
Reproduction
from tokenizers import Tokenizer
from tokenizers.models import WordLevel
from transformers import PreTrainedTokenizerFast
from tensorrt_llm.tokenizer import TransformersTokenizer
raw = PreTrainedTokenizerFast(
tokenizer_object=Tokenizer(WordLevel({"<unk>": 0, "fox": 1}, unk_token="<unk>")),
unk_token="<unk>",
)
raw.add_tokens(["whale"])
wrapped = TransformersTokenizer(raw)
assert wrapped.get_vocab() == raw.get_vocab()
assert len(wrapped) == len(raw) == 3
assert wrapped.vocab_size == raw.vocab_size == 2
Expected behavior
The wrapper should expose the underlying tokenizer's vocabulary map and distinguish the full length including added tokens from its base vocabulary size.
Actual behavior
All three wrapper operations raise NotImplementedError from PreTrainedTokenizerBase. The underlying tokenizer supports all three operations.
Additional notes
The wrapper already delegates encoding, decoding, token conversion, and get_added_vocab(); vocabulary introspection uses inherited base stubs instead. See the Transformers tokenizer interface. Searches for TransformersTokenizer get_vocab, TokenizerBase get_vocab, and vocabulary-related NotImplementedError did not identify an equivalent fix.
OpenAI Codex assisted with the reproduction.
- Dominant language
- Python
- Stars
- 15.2k
- Forks
- 3k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 477
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NVIDIA/TensorRT-LLM
-
Bug: AttributeError: 'GptOssConfig' object has no attribute 'rope_scaling_factor' with transformers >= 5.xPossibly taken @NimaVaziri claimed this today. OpenPytorch
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NVIDIA/TensorRT-LLM#23406 ·
Maintainers usually reply within 1 day
-
Inference runtime Windows
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
NVIDIA/TensorRT-LLM#23394 ·
Maintainers usually reply within 1 day
-
[Bug]: MMLU subsampling changes when evaluators are interleavedPossibly taken @LeNeLeNeWo claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
NVIDIA/TensorRT-LLM#23273 ·
Maintainers usually reply within 1 day
-
Trace-replay Pareto window includes the drain when sessions finish out of admission orderPossibly taken @sbeierle claimed this 3 days ago. OpenTesting
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
NVIDIA/TensorRT-LLM#23077 ·
Maintainers usually reply within 1 day
-
LongBench V2 blog command breaks on inline comments after continuationsPossibly taken @ddlw claimed this 25 days ago. OpenDoc
Difficulty 1/5 Under an hour Newbie friendliness 91/100
NVIDIA/TensorRT-LLM#21879 ·
Maintainers usually reply within 1 day
All issues in NVIDIA/TensorRT-LLM
Similar issues
-
[Resource]: SpaicelyOpenresource-submission validation-passed
Difficulty 1/5 Under an hour Newbie friendliness 68/100
hesreallyhim/awesome-claude-code#3875 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
bvis/aegis-hass#725 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
datasektionen/cashflow#468 ·
-
dont call alembic upgrade until we check whether or not the cache DB has an alembic version stampOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
#1643 unrecoverable split: 1 digest with a 403 — two earlier captures of the same URL are real 200sOpen
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Robin-IA/Congressional-Letters-Dev#1684 ·
Maintainers usually reply within 1 day