@@ -1593,18 +1593,9 @@ def create_diffusers_clip_model_from_ldm(
1593
1593
raise ValueError ("The provided checkpoint does not seem to contain a valid CLIP model." )
1594
1594
1595
1595
if is_accelerate_available ():
1596
- unexpected_keys = load_model_dict_into_meta (model , diffusers_format_checkpoint , dtype = torch_dtype )
1596
+ load_model_dict_into_meta (model , diffusers_format_checkpoint , dtype = torch_dtype )
1597
1597
else :
1598
- _ , unexpected_keys = model .load_state_dict (diffusers_format_checkpoint , strict = False )
1599
-
1600
- if model ._keys_to_ignore_on_load_unexpected is not None :
1601
- for pat in model ._keys_to_ignore_on_load_unexpected :
1602
- unexpected_keys = [k for k in unexpected_keys if re .search (pat , k ) is None ]
1603
-
1604
- if len (unexpected_keys ) > 0 :
1605
- logger .warning (
1606
- f"Some weights of the model checkpoint were not used when initializing { cls .__name__ } : \n { [', ' .join (unexpected_keys )]} "
1607
- )
1598
+ model .load_state_dict (diffusers_format_checkpoint , strict = False )
1608
1599
1609
1600
if torch_dtype is not None :
1610
1601
model .to (torch_dtype )
@@ -2061,16 +2052,7 @@ def create_diffusers_t5_model_from_checkpoint(
2061
2052
diffusers_format_checkpoint = convert_sd3_t5_checkpoint_to_diffusers (checkpoint )
2062
2053
2063
2054
if is_accelerate_available ():
2064
- unexpected_keys = load_model_dict_into_meta (model , diffusers_format_checkpoint , dtype = torch_dtype )
2065
- if model ._keys_to_ignore_on_load_unexpected is not None :
2066
- for pat in model ._keys_to_ignore_on_load_unexpected :
2067
- unexpected_keys = [k for k in unexpected_keys if re .search (pat , k ) is None ]
2068
-
2069
- if len (unexpected_keys ) > 0 :
2070
- logger .warning (
2071
- f"Some weights of the model checkpoint were not used when initializing { cls .__name__ } : \n { [', ' .join (unexpected_keys )]} "
2072
- )
2073
-
2055
+ load_model_dict_into_meta (model , diffusers_format_checkpoint , dtype = torch_dtype )
2074
2056
else :
2075
2057
model .load_state_dict (diffusers_format_checkpoint )
2076
2058
0 commit comments