MCPcopy Create free account
hub / github.com/NJU-PCALab/STAR / encode

Method encode

utils_data/opensora/models/text_encoder/t5.py:189–192  ·  view source on GitHub ↗
(self, text)

Source from the content-addressed store, hash-verified

187 requires_grad(self.t5.model, False)
188
189 def encode(self, text):
190 caption_embs, emb_masks = self.t5.get_text_embeddings(text)
191 caption_embs = caption_embs[:, None]
192 return dict(y=caption_embs, mask=emb_masks)
193
194 def null(self, n):
195 null_y = self.y_embedder.y_embedding[None].repeat(n, 1, 1)[:, None]

Callers 6

sampleMethod · 0.45
sample_srMethod · 0.45
sample_sr_freqMethod · 0.45
sampleMethod · 0.45

Calls 1

get_text_embeddingsMethod · 0.45

Tested by

no test coverage detected