|
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | 14 |
|
15 | | -import os |
16 | 15 | from typing import Callable |
17 | 16 |
|
18 | 17 | import numpy as np |
@@ -245,28 +244,6 @@ def __init__( |
245 | 244 | self.latents_mean = latents_mean |
246 | 245 | self.latents_std = 1.0 / latents_std |
247 | 246 |
|
248 | | - @classmethod |
249 | | - def from_pretrained(cls, pretrained_model_name_or_path, **kwargs): |
250 | | - text_encoder_attn_implementation = kwargs.pop("text_encoder_attn_implementation", "flash_attention_2") |
251 | | - if "text_encoder" not in kwargs: |
252 | | - load_kwargs = { |
253 | | - "revision": kwargs.get("revision", None), |
254 | | - "device_map": kwargs.get("device_map", None), |
255 | | - "torch_dtype": kwargs.get("torch_dtype", None), |
256 | | - "attn_implementation": text_encoder_attn_implementation, |
257 | | - } |
258 | | - |
259 | | - if os.path.isdir(pretrained_model_name_or_path): |
260 | | - text_encoder_path = os.path.join(pretrained_model_name_or_path, "text_encoder") |
261 | | - else: |
262 | | - text_encoder_path = pretrained_model_name_or_path |
263 | | - load_kwargs["subfolder"] = "text_encoder" |
264 | | - kwargs["text_encoder"] = Qwen2_5_VLForConditionalGeneration.from_pretrained( |
265 | | - text_encoder_path, **load_kwargs |
266 | | - ) |
267 | | - |
268 | | - return super().from_pretrained(pretrained_model_name_or_path, **kwargs) |
269 | | - |
270 | 247 | def get_latent_shape_cthw(self, height: int, width: int, num_frames: int): |
271 | 248 | C = self.vae.config.z_dim |
272 | 249 | T = (num_frames - 1) // self.vae_scale_factor_temporal + 1 |
|
0 commit comments