Skip to content

Make repo structure consistent #1862

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Dec 30, 2022
Merged

Make repo structure consistent #1862

merged 16 commits into from
Dec 30, 2022

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 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!

@@ -1,7 +1,6 @@
__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.

👍

patrickvonplaten and others added 2 commits December 30, 2022 11:32
Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
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 <pedro@huggingface.co>

* correct

Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
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.

4 participants