MCPcopy Create free account
hub / github.com/OpenMeshLab/MeshXL / encode_text

Method encode_text

models/x_mesh_xl/get_model.py:33–39  ·  view source on GitHub ↗
(self, input_ids, attention_mask)

Source from the content-addressed store, hash-verified

31
32 @torch.no_grad()
33 def encode_text(self, input_ids, attention_mask):
34 text_encoder_output = self.multi_encoder.text_model(
35 input_ids=input_ids,
36 attention_mask=attention_mask
37 )
38 text_embeds = text_encoder_output.last_hidden_state
39 return text_embeds # bs x ntoken x ch
40
41 def forward(self, input_ids, attention_mask):
42 net_device = next(self.parameters()).device

Callers 1

forwardMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected