Skip to content

Commit 7602952

Browse files
committed
remove saving for now
1 parent a793066 commit 7602952

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

src/diffusers/pipelines/pipeline_utils.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ def save_pretrained(
193193
variant: Optional[str] = None,
194194
max_shard_size: Optional[Union[int, str]] = None,
195195
push_to_hub: bool = False,
196-
dduf_file: Optional[Union[str, os.PathLike]] = None,
197196
**kwargs,
198197
):
199198
"""
@@ -219,8 +218,6 @@ class implements both a save and loading method. The pipeline is easily reloaded
219218
Whether or not to push your model to the Hugging Face model hub after saving it. You can specify the
220219
repository you want to push to with `repo_id` (will default to the name of `save_directory` in your
221220
namespace).
222-
dduf_file (`str` or `os.PathLike`, *optional*, defaults to `None`):
223-
If specified, the weights will be saved in dduf format with the specified name.
224221
225222
kwargs (`Dict[str, Any]`, *optional*):
226223
Additional keyword arguments passed along to the [`~utils.PushToHubMixin.push_to_hub`] method.
@@ -305,29 +302,9 @@ def is_saveable_module(name, value):
305302

306303
save_method(os.path.join(save_directory, pipeline_component_name), **save_kwargs)
307304

308-
if dduf_file:
309-
import shutil
310-
311-
from huggingface_hub import export_folder_as_dduf
312-
313-
dduf_file_path = os.path.join(save_directory, dduf_file)
314-
dir_to_archive = os.path.join(save_directory, pipeline_component_name)
315-
if os.path.isdir(dir_to_archive):
316-
export_folder_as_dduf(dduf_file_path, dir_to_archive)
317-
shutil.rmtree(dir_to_archive)
318-
319305
# finally save the config
320306
self.save_config(save_directory)
321307

322-
# Takes care of including the "model_index.json" inside the ZIP.
323-
if dduf_file:
324-
from huggingface_hub import add_entry_to_dduf
325-
326-
config_path = os.path.join(save_directory, self.config_name)
327-
# add config.json to the root of the dduf_file_path
328-
add_entry_to_dduf(dduf_file_path, self.config_name, content=config_path)
329-
os.remove(config_path)
330-
331308
if push_to_hub:
332309
# Create a new empty model card and eventually tag it
333310
model_card = load_or_create_model_card(repo_id, token=token, is_pipeline=True)

0 commit comments

Comments
 (0)