parent
aadec68812
commit
ed9c9b9034
|
|
@ -1930,9 +1930,8 @@ class SDTrainer(BaseSDTrainProcess):
|
|||
encoded = {}
|
||||
for source_name, prompts in source_prompts.items():
|
||||
with self._activator_mode('full'):
|
||||
active_embeds = self.sd.encode_prompt(
|
||||
active_embeds = self.sd.get_prompt_embeds(
|
||||
prompts,
|
||||
long_prompts=self.do_long_prompts,
|
||||
return_taps=context_config.enabled,
|
||||
)
|
||||
active_pred = self.predict_noise(
|
||||
|
|
@ -1946,9 +1945,8 @@ class SDTrainer(BaseSDTrainProcess):
|
|||
)
|
||||
with self._activator_mode('activator_bypass'):
|
||||
with torch.no_grad():
|
||||
bypass_embeds = self.sd.encode_prompt(
|
||||
bypass_embeds = self.sd.get_prompt_embeds(
|
||||
prompts,
|
||||
long_prompts=self.do_long_prompts,
|
||||
return_taps=context_config.enabled,
|
||||
).detach()
|
||||
bypass_pred = self.predict_noise(
|
||||
|
|
|
|||
|
|
@ -331,7 +331,7 @@ class ThreePhaseRuntimeTest(unittest.TestCase):
|
|||
trainer.do_long_prompts = False
|
||||
trainer.additional_logs = {}
|
||||
trainer.sd = SimpleNamespace(
|
||||
encode_prompt=lambda prompts, **kwargs: _FakeEmbeds(len(prompts)),
|
||||
get_prompt_embeds=lambda prompts, **kwargs: _FakeEmbeds(len(prompts)),
|
||||
get_loss_target=lambda noise, batch, timesteps: noise + 1,
|
||||
)
|
||||
calls = []
|
||||
|
|
@ -397,7 +397,7 @@ class ThreePhaseRuntimeTest(unittest.TestCase):
|
|||
return embeds
|
||||
|
||||
trainer.sd = SimpleNamespace(
|
||||
encode_prompt=encode,
|
||||
get_prompt_embeds=encode,
|
||||
get_loss_target=lambda noise, batch, timesteps: noise,
|
||||
)
|
||||
trainer.predict_noise = lambda noisy_latents, **kwargs: (
|
||||
|
|
|
|||
Loading…
Reference in New Issue