[PR #158] fix: load siglip checkpoint with weights_only=True #155

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

📋 Pull Request Information

Original PR: https://github.com/deepseek-ai/DeepSeek-VL2/pull/158
Author: @Dextheking1
Created: 10/23/2026
Status: 🔄 Open

Base: main ← Head: fix/siglip-torch-load-weights-only


📝 Commits (1)

  • 522c82e fix: load siglip checkpoint with weights_only=True

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 deepseek_vl2/models/siglip_vit.py (+1 -1)

📄 Description

create_siglip_vit loads ckpt_path with a bare torch.load.

on torch 2.0.1, the version pinned in requirements.txt, that unpickles the whole file. a checkpoint from anywhere runs code on load. weights_only=True stops that, and plain tensor state dicts still load fine, which is all this function takes.

verified with torch 2.5.1 cpu and a test checkpoint holding a pickle payload that writes a marker file on load. before: marker written. after: load refused with UnpicklingError, no marker. a normal state dict with a tensor loads the same as before.


🔄 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/DeepSeek-VL2/pull/158 **Author:** [@Dextheking1](https://github.com/Dextheking1) **Created:** 10/23/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/siglip-torch-load-weights-only` --- ### 📝 Commits (1) - [`522c82e`](https://github.com/deepseek-ai/DeepSeek-VL2/commit/522c82e6293174566255d9ac0cdf692163412a45) fix: load siglip checkpoint with weights_only=True ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `deepseek_vl2/models/siglip_vit.py` (+1 -1) </details> ### 📄 Description create_siglip_vit loads ckpt_path with a bare torch.load. on torch 2.0.1, the version pinned in requirements.txt, that unpickles the whole file. a checkpoint from anywhere runs code on load. weights_only=True stops that, and plain tensor state dicts still load fine, which is all this function takes. verified with torch 2.5.1 cpu and a test checkpoint holding a pickle payload that writes a marker file on load. before: marker written. after: load refused with UnpicklingError, no marker. a normal state dict with a tensor loads the same as before. --- <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/DeepSeek-VL2#155
No description provided.