Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/multimodal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Update the paths to point to the mcore converted CLIP and Mistral models and run
examples/multimodal/combine_lm_vision_checkpoints.sh /path/to/mistral/model /path/to/clip/model /output/dir
```

> **Note:** If you encounter a loading error, try setting `TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1`.

## Training

### Pretraining
Expand Down
4 changes: 3 additions & 1 deletion examples/multimodal/combine_state_dicts.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ def combine(input_files, module_prefixes, output_files):
zip(current_input_files, current_module_prefixes)
):
# initialize the combined state dict using the first provided input file
current_state_dict = torch.load(input_file, weights_only=False)
# NOTE: To load legacy checkpoints, set TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1
# (only use with trusted files — allows arbitrary code execution).
current_state_dict = torch.load(input_file)
if i == 0:
combined_state_dict = current_state_dict.copy()
combined_state_dict["model"] = dict()
Expand Down
Loading