Skip to content

Allow custom pipeline loading#3504

Merged
patrickvonplaten merged 1 commit intomainfrom
improve_custom_pipeline_loading
May 23, 2023
Merged

Allow custom pipeline loading#3504
patrickvonplaten merged 1 commit intomainfrom
improve_custom_pipeline_loading

Conversation

@patrickvonplaten
Copy link
Copy Markdown
Contributor

@patrickvonplaten patrickvonplaten commented May 22, 2023

This PR refactors the way pipelines are loaded and thus solves: #3231

if is_pipeline_module:
library = pipeline_dir
elif library not in LOADABLE_CLASSES:
library = module.__module__
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If pipeline is neither in LOADABLE_CLASSES nor is a pipeline module we should save the whole module path

# 6.2 Define all importable classes
is_pipeline_module = hasattr(pipelines, library_name)
importable_classes = ALL_IMPORTABLE_CLASSES if is_pipeline_module else LOADABLE_CLASSES[library_name]
importable_classes = ALL_IMPORTABLE_CLASSES
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unnecessary, we can always just use "ALL Importable classes" as long as names differ (which we assume right now)

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

HuggingFaceDocBuilderDev commented May 22, 2023

The documentation is not available anymore as the PR was closed or merged.

@patrickvonplaten patrickvonplaten merged commit d4197bf into main May 23, 2023
@pcuenca pcuenca deleted the improve_custom_pipeline_loading branch May 23, 2023 12:25
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants