Open
Conversation
… with custom attrs
sideblock, mask_token, and patch_embedding_* are YUME additions not saved in diffusion_pytorch_model.safetensors; they must stay freshly initialized. strict=True failed with 'Missing key(s) in state_dict'. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ult_device() crash torch.set_default_device(None) left the default as None; newer transformers calls torch.get_default_device() and tries to access .device on the result, crashing with AttributeError. Setting "cpu" gives transformers a valid device while still allowing low_cpu_mem_usage load followed by .to(device). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The previous workaround (_st.load(_f.read())) read the full safetensors file into a Python bytes object then deserialized it, requiring ~2x the checkpoint size in CPU RAM and causing pyo3 OOM panic on large models. load_file(device=) streams each tensor directly to the target device via mmap, avoiding the intermediate CPU copy entirely. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… error low_cpu_mem_usage=True triggers init_empty_weights() which creates tensors on meta device. InternVL3's __init__ calls torch.linspace().item() during construction, which raises RuntimeError on meta tensors. Loading without low_cpu_mem_usage uses more CPU RAM transiently but avoids the meta device context entirely. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
No description provided.