From acb43d772dba16a0325ec95d90408cb4c440d080 Mon Sep 17 00:00:00 2001 From: Lunwen He Date: Tue, 15 Oct 2024 16:40:28 -0700 Subject: [PATCH] Do not raise error when there is mixed dtype in the checkpoint Summary: 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. Differential Revision: D64438373 --- examples/models/checkpoint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/models/checkpoint.py b/examples/models/checkpoint.py index cd916142d9c..592ebab1450 100644 --- a/examples/models/checkpoint.py +++ b/examples/models/checkpoint.py @@ -67,7 +67,7 @@ def get_checkpoint_dtype(checkpoint: Dict[str, Any]) -> Optional[str]: if value.dtype != dtype ] if len(mismatched_dtypes) > 0: - raise ValueError( + print( f"Mixed dtype model. Dtype of {first_key}: {first.dtype}. Mismatches in the checkpoint: {mismatched_dtypes}" ) return dtype