Update all files for BitDance-ImageNet-diffusers
Browse files
BitDance_B_4x/autoencoder/modeling_autoencoder.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
from diffusers.configuration_utils import ConfigMixin, register_to_config
|
| 4 |
+
from diffusers.models.modeling_utils import ModelMixin
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
class BitDanceImageNetAutoencoder(ModelMixin, ConfigMixin):
|
| 8 |
+
@register_to_config
|
| 9 |
+
def __init__(self, ddconfig=None, num_codebooks: int = 4, **kwargs):
|
| 10 |
+
super().__init__()
|
| 11 |
+
self.ddconfig = ddconfig
|
| 12 |
+
self.num_codebooks = num_codebooks
|
| 13 |
+
|
| 14 |
+
@classmethod
|
| 15 |
+
def from_pretrained(cls, pretrained_model_name_or_path: str, *args, **kwargs):
|
| 16 |
+
del pretrained_model_name_or_path, args, kwargs
|
| 17 |
+
return cls()
|