MCPcopy Create free account
hub / github.com/microsoft/Cream / teacher_text_encoder_fn

Method teacher_text_encoder_fn

TinyCLIP/src/open_clip/model.py:963–966  ·  view source on GitHub ↗
(text, normalized=False)

Source from the content-addressed store, hash-verified

961
962 def use_teacher_text(self):
963 def teacher_text_encoder_fn(text, normalized=False):
964 teacher = self.get_teacher()
965 with torch.no_grad():
966 return teacher.encode_text(text, normalized=normalized)
967 self._text_encoder = FNBlock(teacher_text_encoder_fn)
968
969 class EmptyTransformer(nn.Module):

Callers

nothing calls this directly

Calls 2

get_teacherMethod · 0.95
encode_textMethod · 0.45

Tested by

no test coverage detected