Skip to content

ModularPipeline.save_pretrained: change the default overwrite_modular_index to be True - #14659

Open
yiyixuxu wants to merge 2 commits into
mainfrom
docs-modular-local-copies
Open

ModularPipeline.save_pretrained: change the default overwrite_modular_index to be True#14659
yiyixuxu wants to merge 2 commits into
mainfrom
docs-modular-local-copies

Conversation

@yiyixuxu

Copy link
Copy Markdown
Collaborator

cc @DN6

Just a proposal, but I think since save_pretrained now saves the loaded components by default, it makes sense for overwrite_modular_index to default to True as well — otherwise the result is not very intuitive: e.g. when you run

  pipe = ModularPipeline.from_pretrained(repo_id)
  pipe.load_components() 
  pipe.save_pretrained(local_dir)

the components are all saved into local_dir, but its modular_model_index.json still points at repo_id — so reloading from the local_dir still fetch everything from hub even though weights are in the local folder

  pipe = ModularPipeline.from_pretrained(local_dir)
  pipe.load_components()

It's especially confusing if you intended to save a self-contained local copy with some custom components

See related issues: #14251, #14640

@github-actions github-actions Bot added size/M PR with diff < 200 LOC tests modular-pipelines and removed size/M PR with diff < 200 LOC labels Aug 31, 2026
@yiyixuxu
yiyixuxu requested a review from DN6 August 31, 2026 08:42
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@github-actions github-actions Bot added documentation Improvements or additions to documentation size/M PR with diff < 200 LOC labels Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation modular-pipelines size/M PR with diff < 200 LOC tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants