Skip to content

Conversation

@ybwowen
Copy link

@ybwowen ybwowen commented Oct 7, 2025

In the latest release of safetensors, strictly loading the model will also compare the dtype. By setting strict=False, we allow load weights of different precisions. For example, if we save the model with a precision of bfloat16 (which is the default setting in the jax to pytorch script), we fail to load the checkpoint if we set strict=True.

Please refer to: https://github.com/huggingface/safetensors/blob/aa6c43d729868fc43918e862d42bfeaf60485d1d/bindings/python/py_src/safetensors/torch.py#L252.

In the latest release of safetensors, strictly loading the model will also compare the dtype. By setting strict=False, we allow load weights of different precisions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant