MCPcopy
hub / github.com/hpcaitech/Open-Sora / encode

Method encode

opensora/models/text_encoder/t5.py:194–197  ·  view source on GitHub ↗
(self, input_ids, attention_mask=None)

Source from the content-addressed store, hash-verified

192 return self.t5.tokenize_fn
193
194 def encode(self, input_ids, attention_mask=None):
195 caption_embs, emb_masks = self.t5.get_text_embeddings(input_ids, attention_mask)
196 caption_embs = caption_embs[:, None]
197 return dict(y=caption_embs, mask=emb_masks)
198
199 def null(self, n):
200 null_y = self.y_embedder.y_embedding[None].repeat(n, 1, 1)[:, None]

Callers 15

writePFMFunction · 0.45
writeFlowFunction · 0.45
writeFloatFunction · 0.45
collect_references_batchFunction · 0.45
append_generatedFunction · 0.45
aug_xFunction · 0.45
sampleMethod · 0.45
sampleMethod · 0.45
sampleMethod · 0.45
sample_debugMethod · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls 1

get_text_embeddingsMethod · 0.80

Tested by

no test coverage detected