Conversation
Cosmos3Runner.load_text_encoder hard-coded trust_remote_code=True with no override, so a model bundle's tokenizer_config.json auto_map ran unconditionally regardless of caller intent. It now reads trust_remote_code from config and defaults to False. Refs ModelTC#1559
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.
Fixes the first sink from the report:
Cosmos3Runner.load_text_encoderhard-codedtrust_remote_code=Truewith no way to turn it off, so a bundle'stokenizer_config.jsonauto_mapran unconditionally. It now readstrust_remote_codefrom config and defaults toFalse; set it explicitly if your tokenizer genuinely needs custom code.Scope: this only covers the Cosmos3 tokenizer load. I didn't touch the metadata
model_clssubstitution inset_config.pyor the othertrust_remote_code=Truecalls inmotus/model.pyandpaint_pipeline.pythat the report also flags, those need an allowlist and their own review, so I left them out and usedRefsinstead ofFixeson the issue.Added two tests: default is
False, and the same failure shows on main today; explicit opt-in still works. Ran them plusruff check/ruff formatin a CPU-only container (SKIP_PLATFORM_CHECK=1, no GPU available here), both clean.