MCPcopy Create free account
hub / github.com/ml-explore/mlx-examples / __init__

Method __init__

clip/model.py:198–202  ·  view source on GitHub ↗
(self, config: CLIPTextConfig)

Source from the content-addressed store, hash-verified

196 """Implements the text encoder transformer from CLIP."""
197
198 def __init__(self, config: CLIPTextConfig):
199 super().__init__()
200 self.embeddings = TextEmbeddings(config)
201 self.encoder = Encoder(config)
202 self.final_layer_norm = nn.LayerNorm(config.hidden_size)
203
204 def __call__(self, x: mx.array) -> CLIPTextOutput:
205 B, N = x.shape

Callers

nothing calls this directly

Calls 3

TextEmbeddingsClass · 0.85
EncoderClass · 0.70
__init__Method · 0.45

Tested by

no test coverage detected