MCPcopy Create free account
hub / github.com/CHENGY12/PLOT / __init__

Method __init__

plot-pp/trainers/plotpp.py:38–44  ·  view source on GitHub ↗
(self, clip_model)

Source from the content-addressed store, hash-verified

36
37class TextEncoder(nn.Module):
38 def __init__(self, clip_model):
39 super().__init__()
40 self.transformer = clip_model.transformer
41 self.positional_embedding = clip_model.positional_embedding
42 self.ln_final = clip_model.ln_final
43 self.text_projection = clip_model.text_projection
44 self.dtype = clip_model.dtype
45
46 def forward(self, prompts, tokenized_prompts):
47 x = prompts + self.positional_embedding.type(self.dtype)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected