File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
invokeai/backend/model_manager/load/model_cache/cached_model Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,8 @@ def full_load_to_vram(self) -> int:
78
78
new_state_dict [k ] = v .to (self ._compute_device , copy = True )
79
79
self ._model .load_state_dict (new_state_dict , assign = True )
80
80
81
- check_for_gguf = self ._model .state_dict ().get ("img_in.weight" )
81
+
82
+ check_for_gguf = hasattr (self ._model , 'state_dict' ) and self ._model .state_dict ().get ("img_in.weight" )
82
83
if isinstance (check_for_gguf , GGMLTensor ):
83
84
old_value = torch .__future__ .get_overwrite_module_params_on_conversion ()
84
85
torch .__future__ .set_overwrite_module_params_on_conversion (True )
@@ -102,7 +103,7 @@ def full_unload_from_vram(self) -> int:
102
103
if self ._cpu_state_dict is not None :
103
104
self ._model .load_state_dict (self ._cpu_state_dict , assign = True )
104
105
105
- check_for_gguf = self ._model .state_dict ().get ("img_in.weight" )
106
+ check_for_gguf = hasattr ( self . _model , 'state_dict' ) and self ._model .state_dict ().get ("img_in.weight" )
106
107
if isinstance (check_for_gguf , GGMLTensor ):
107
108
old_value = torch .__future__ .get_overwrite_module_params_on_conversion ()
108
109
torch .__future__ .set_overwrite_module_params_on_conversion (True )
You can’t perform that action at this time.
0 commit comments