Skip to content

Conversation

@patrickvonplaten
Copy link
Contributor

@patrickvonplaten patrickvonplaten commented Dec 29, 2022

This PR restructures the repo a bit:

  • Files that are only relevant for models are put under src/diffusers/models
  • Files that are only relevant for pipelines are put under src/diffusers/pipelines
  • Models, such as "Unet2DCondition", "Transformer2DModel", ... are put into individual files and separated from subclass files such as attention.py.
  • Multiple fixes such as removing non-relative imports inside diffusers etc...

from diffusers.schedulers import UnCLIPScheduler
from transformers import CLIPTextModelWithProjection, CLIPTokenizer

from ...models import PriorTransformer, UNet2DConditionModel, UNet2DModel
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@williamberman inside src/diffusers we always use relative imports to make sure the pypi package is nicely self-contained.

@patrickvonplaten patrickvonplaten changed the title Restructure repo Make repo structure consistent Dec 29, 2022
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Dec 29, 2022

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

Copy link
Member

@pcuenca pcuenca left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the effort!

__version__ = "0.12.0.dev0"

from .configuration_utils import ConfigMixin
from .onnx_utils import OnnxRuntimeModel
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@patil-suraj patil-suraj left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks for workingon this!

@patrickvonplaten patrickvonplaten merged commit 29b2c93 into main Dec 30, 2022
@patrickvonplaten patrickvonplaten deleted the restructure_repo branch December 30, 2022 10:51
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
* move files a bit

* more refactors

* fix more

* more fixes

* fix more onnx

* make style

* upload

* fix

* up

* fix more

* up again

* up

* small fix

* Update src/diffusers/__init__.py

Co-authored-by: Pedro Cuenca <[email protected]>

* correct

Co-authored-by: Pedro Cuenca <[email protected]>
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.

5 participants