MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / _encode_prompt

Method _encode_prompt

diffusers/examples/community/sde_drag.py:348–362  ·  view source on GitHub ↗
(self, input_ids, attention_mask, text_encoder_use_attention_mask=False)

Source from the content-addressed store, hash-verified

346 return text_inputs
347
348 def _encode_prompt(self, input_ids, attention_mask, text_encoder_use_attention_mask=False):
349 text_input_ids = input_ids.to(self.device)
350
351 if text_encoder_use_attention_mask:
352 attention_mask = attention_mask.to(self.device)
353 else:
354 attention_mask = None
355
356 prompt_embeds = self.text_encoder(
357 text_input_ids,
358 attention_mask=attention_mask,
359 )
360 prompt_embeds = prompt_embeds[0]
361
362 return prompt_embeds
363
364 @torch.no_grad()
365 def _get_text_embed(self, prompt):

Callers 4

train_loraMethod · 0.95
__call__Method · 0.45
__call__Method · 0.45
__call__Method · 0.45

Calls 1

toMethod · 0.45

Tested by

no test coverage detected