Repository navigation
refactor(tokenizers): stop shipping qwen.tiktoken in jars - #293
Merged
Merged
Conversation
Resolve the vocab at runtime from DASHSCOPE_QWEN_VOCAB, the classpath, or a SHA256-verified ModelScope download cached under ~/.cache/dashscope/tokenizers, mirroring dashscope-sdk-python#237.
… cache - Remove qwen.tiktoken from git and .gitignore tracking due to large file size - Update pom.xml to exclude qwen.tiktoken from distribution jars with clarifying comments - Modify QwenTokenizer to resolve vocab by downloading from ModelScope on first use and cache locally - Allow manual local copy in classpath for offline development and testing - Add test to ensure verified local cache exists before environment variable override tests - Update test cases for default resolution from cache, classpath, or download and environment variable override usage
2 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
qwen.tiktokenvocab no longer ships in distribution jars.QwenTokenizerresolves the vocab at runtime, in order:DASHSCOPE_QWEN_VOCABenv var (with~expansion) → classpath resource (source checkouts) → SHA256-verified cache under~/.cache/dashscope/tokenizers→ ModelScope download (temp file + SHA256 check + atomic replace), with offline manual-download guidance on failure. JDK-only implementation, Java 8 compatible, no new dependencies.maven-jar-pluginandmaven-source-pluginexcludeqwen.tiktoken; the file stays insrc/main/resourcesso source checkouts and tests keep working offline.Test plan
TestQwenTokenizerVocabResolution(env override, missing file,~expansion, sha256, classpath fallback) and existingTestTikTokenTokenizerpass; full test suite green.qwen.tiktokenentry.b2b1b8df…3186), caches under~/.cache/dashscope/tokenizers, and encodes the expected token ids.