MCPcopy Create free account
hub / github.com/caoql98/DCPL / __init__

Method __init__

trainers/maple.py:44–50  ·  view source on GitHub ↗
(self, clip_model)

Source from the content-addressed store, hash-verified

42
43class TextEncoder(nn.Module):
44 def __init__(self, clip_model):
45 super().__init__()
46 self.transformer = clip_model.transformer
47 self.positional_embedding = clip_model.positional_embedding
48 self.ln_final = clip_model.ln_final
49 self.text_projection = clip_model.text_projection
50 self.dtype = clip_model.dtype
51
52 def forward(self, prompts, tokenized_prompts, compound_prompts_deeper_text):
53 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