mirror of
https://github.com/deepseek-ai/Janus.git
synced 2026-11-05 00:57:18 +00:00
[PR #243] drop trust_remote_code=True from model loads #235
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/Janus#235
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/deepseek-ai/Janus/pull/243
Author: @Dextheking1
Created: 10/23/2026
Status: 🔄 Open
Base:
main← Head:fix/drop-trust-remote-code📝 Commits (7)
49125d5inference.py: drop trust_remote_code=True from model load722d1f3generation_inference.py: drop trust_remote_code=True from model loadf43423einteractivechat.py: drop trust_remote_code=True from model load674b4fajanus/utils/io.py: drop trust_remote_code=True from model loade8d5eaddemo/app.py: drop trust_remote_code=True from model load3c25217demo/app_januspro.py: drop trust_remote_code=True from model load8fab383demo/fastapi_app.py: drop trust_remote_code=True from model load📊 Changes
7 files changed (+7 additions, -10 deletions)
View changed files
📝
demo/app.py(+1 -2)📝
demo/app_januspro.py(+1 -2)📝
demo/fastapi_app.py(+1 -2)📝
generation_inference.py(+1 -1)📝
inference.py(+1 -1)📝
interactivechat.py(+1 -1)📝
janus/utils/io.py(+1 -1)📄 Description
the model and config classes are registered locally in janus/models/modeling_vlm.py, so remote code is not needed to load Janus checkpoints.
with trust_remote_code=True, python files from the checkpoint repo run on the host at load time. anyone who points model_path at a third party fine-tune gets code exec on load. checked with a local test checkpoint holding a custom tokenizer module: transformers refuses it without the flag and runs the module code with trust_remote_code=True.
covers inference.py, generation_inference.py, interactivechat.py, janus/utils/io.py, demo/app.py, demo/app_januspro.py and demo/fastapi_app.py. syntax checked with py_compile. full model load not run here, no weights on this box.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.