File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
src/diffusers/modular_pipelines Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -1916,17 +1916,15 @@ def save_pretrained(
19161916 for component_name , component_spec in self ._component_specs .items ():
19171917 if component_spec .default_creation_method != "from_pretrained" :
19181918 continue
1919- sub_model = getattr (self , component_name , None )
1920- if sub_model is None :
1919+ if component_name not in self .config :
19211920 continue
19221921
1923- component_spec .pretrained_model_name_or_path = repo_id
1924- component_spec .subfolder = component_name
1925- if variant is not None and hasattr (component_spec , "variant" ):
1926- component_spec .variant = variant
1922+ library , class_name , component_spec_dict = self .config [component_name ]
1923+ component_spec_dict ["pretrained_model_name_or_path" ] = repo_id
1924+ component_spec_dict ["subfolder" ] = component_name
1925+ if variant is not None and "variant" in component_spec_dict :
1926+ component_spec_dict ["variant" ] = variant
19271927
1928- library , class_name = _fetch_class_library_tuple (sub_model )
1929- component_spec_dict = self ._component_spec_to_dict (component_spec )
19301928 self .register_to_config (** {component_name : (library , class_name , component_spec_dict )})
19311929
19321930 self .save_config (save_directory = save_directory )
You can’t perform that action at this time.
0 commit comments