Skip to content

Commit

Permalink
[Refactor] harmonize the module structure for models in tests (huggin…
Browse files Browse the repository at this point in the history
…gface#6738)

* harmonize the module structure for models in tests

* make the folders modules.

---------

Co-authored-by: YiYi Xu <[email protected]>
  • Loading branch information
sayakpaul and yiyixuxu authored Feb 1, 2024
1 parent 093a03a commit ec9840a
Show file tree
Hide file tree
Showing 15 changed files with 10 additions and 10 deletions.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
)
from diffusers.utils.torch_utils import randn_tensor

from .test_modeling_common import ModelTesterMixin, UNetTesterMixin
from ..test_modeling_common import ModelTesterMixin, UNetTesterMixin


enable_full_determinism()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from diffusers.utils import is_flax_available
from diffusers.utils.testing_utils import require_flax

from .test_modeling_common_flax import FlaxModelTesterMixin
from ..test_modeling_common_flax import FlaxModelTesterMixin


if is_flax_available():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
torch_device,
)

from .test_modeling_common import ModelTesterMixin, UNetTesterMixin
from ..test_modeling_common import ModelTesterMixin, UNetTesterMixin


enable_full_determinism()
Expand Down
Empty file added tests/models/unets/__init__.py
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
torch_device,
)

from .test_modeling_common import ModelTesterMixin, UNetTesterMixin
from ..test_modeling_common import ModelTesterMixin, UNetTesterMixin


class UNet1DModelTests(ModelTesterMixin, UNetTesterMixin, unittest.TestCase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
torch_device,
)

from .test_modeling_common import ModelTesterMixin, UNetTesterMixin
from ..test_modeling_common import ModelTesterMixin, UNetTesterMixin


logger = logging.get_logger(__name__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
torch_device,
)

from .test_modeling_common import ModelTesterMixin, UNetTesterMixin
from ..test_modeling_common import ModelTesterMixin, UNetTesterMixin


logger = logging.get_logger(__name__)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from diffusers.utils.import_utils import is_xformers_available
from diffusers.utils.testing_utils import enable_full_determinism, floats_tensor, skip_mps, torch_device

from .test_modeling_common import ModelTesterMixin, UNetTesterMixin
from ..test_modeling_common import ModelTesterMixin, UNetTesterMixin


enable_full_determinism()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
torch_device,
)

from .test_modeling_common import ModelTesterMixin, UNetTesterMixin
from ..test_modeling_common import ModelTesterMixin, UNetTesterMixin


logger = logging.get_logger(__name__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
torch_device,
)

from .test_modeling_common import ModelTesterMixin, UNetTesterMixin
from ..test_modeling_common import ModelTesterMixin, UNetTesterMixin


logger = logging.get_logger(__name__)
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/pipelines/test_pipelines_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
torch_device,
)

from ..models.test_models_vae import (
from ..models.autoencoders.test_models_vae import (
get_asym_autoencoder_kl_config,
get_autoencoder_kl_config,
get_autoencoder_tiny_config,
Expand Down

0 comments on commit ec9840a

Please sign in to comment.