Skip to content

Commit 41ffa93

Browse files
Lunwen Hefacebook-github-bot
authored andcommitted
Do not raise error when there is mixed dtype in the checkpoint (#6247)
Summary: Pull Request resolved: #6247 This warning message got turned into an exception during the refactor of D64145852. It fails our export flow for llama 3.2 1B/3B. This diff fixes it. Reviewed By: mergennachin, dvorjackz Differential Revision: D64438373 fbshipit-source-id: 3dbfe44b95c94111de8cb2773ee9e642f9b896e6
1 parent dae765e commit 41ffa93

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/models/checkpoint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def get_checkpoint_dtype(checkpoint: Dict[str, Any]) -> Optional[str]:
6767
if value.dtype != dtype
6868
]
6969
if len(mismatched_dtypes) > 0:
70-
raise ValueError(
70+
print(
7171
f"Mixed dtype model. Dtype of {first_key}: {first.dtype}. Mismatches in the checkpoint: {mismatched_dtypes}"
7272
)
7373
return dtype

0 commit comments

Comments
 (0)