[PR #243] drop trust_remote_code=True from model loads #235

Open
opened 2026-10-26 21:14:26 +00:00 by bsakaguchi · 0 comments
Owner

📋 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)

  • 49125d5 inference.py: drop trust_remote_code=True from model load
  • 722d1f3 generation_inference.py: drop trust_remote_code=True from model load
  • f43423e interactivechat.py: drop trust_remote_code=True from model load
  • 674b4fa janus/utils/io.py: drop trust_remote_code=True from model load
  • e8d5ead demo/app.py: drop trust_remote_code=True from model load
  • 3c25217 demo/app_januspro.py: drop trust_remote_code=True from model load
  • 8fab383 demo/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.

## 📋 Pull Request Information **Original PR:** https://github.com/deepseek-ai/Janus/pull/243 **Author:** [@Dextheking1](https://github.com/Dextheking1) **Created:** 10/23/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/drop-trust-remote-code` --- ### 📝 Commits (7) - [`49125d5`](https://github.com/deepseek-ai/Janus/commit/49125d5523ef1e74b94bd726ad74f3bbb2411fca) inference.py: drop trust_remote_code=True from model load - [`722d1f3`](https://github.com/deepseek-ai/Janus/commit/722d1f36176632cdfb82ed9269eb0620fb0107dd) generation_inference.py: drop trust_remote_code=True from model load - [`f43423e`](https://github.com/deepseek-ai/Janus/commit/f43423e55f19bbb20b7b68a14d35f6b4d4f575eb) interactivechat.py: drop trust_remote_code=True from model load - [`674b4fa`](https://github.com/deepseek-ai/Janus/commit/674b4fa837a43c047fe36dc47e1b17d804dfa296) janus/utils/io.py: drop trust_remote_code=True from model load - [`e8d5ead`](https://github.com/deepseek-ai/Janus/commit/e8d5ead0e99d2a15bbcd3e8c2931328333ac7241) demo/app.py: drop trust_remote_code=True from model load - [`3c25217`](https://github.com/deepseek-ai/Janus/commit/3c252177648f44a283109a2240152031c61664e8) demo/app_januspro.py: drop trust_remote_code=True from model load - [`8fab383`](https://github.com/deepseek-ai/Janus/commit/8fab383b2a6018715ea779ea5b839285979cd651) demo/fastapi_app.py: drop trust_remote_code=True from model load ### 📊 Changes **7 files changed** (+7 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `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) </details> ### 📄 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/Janus#235
No description provided.