MCPcopy Create free account
hub / github.com/VisionXLab/OF-Diff / __init__

Method __init__

ldm/modules/encoders/modules.py:199–205  ·  view source on GitHub ↗
(self, clip_version="openai/clip-vit-large-patch14", t5_version="google/t5-v1_1-xl", device="cuda",
                 clip_max_length=77, t5_max_length=77)

Source from the content-addressed store, hash-verified

197
198class FrozenCLIPT5Encoder(AbstractEncoder):
199 def __init__(self, clip_version="openai/clip-vit-large-patch14", t5_version="google/t5-v1_1-xl", device="cuda",
200 clip_max_length=77, t5_max_length=77):
201 super().__init__()
202 self.clip_encoder = FrozenCLIPEmbedder(clip_version, device, max_length=clip_max_length)
203 self.t5_encoder = FrozenT5Embedder(t5_version, device, max_length=t5_max_length)
204 print(f"{self.clip_encoder.__class__.__name__} has {count_params(self.clip_encoder)*1.e-6:.2f} M parameters, "
205 f"{self.t5_encoder.__class__.__name__} comes with {count_params(self.t5_encoder)*1.e-6:.2f} M params.")
206
207 def encode(self, text):
208 return self(text)

Callers

nothing calls this directly

Calls 4

count_paramsFunction · 0.90
FrozenCLIPEmbedderClass · 0.85
FrozenT5EmbedderClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected