This commit is contained in:
Patrick von Platen 2022-06-27 09:23:14 +00:00
commit 014ebc594d
1 changed files with 2 additions and 2 deletions

View File

@ -1431,11 +1431,11 @@ class LatentDiffusionPipeline(DiffusionPipeline):
uncond_input = self.tokenizer([""], padding="max_length", max_length=77, return_tensors="pt").to( uncond_input = self.tokenizer([""], padding="max_length", max_length=77, return_tensors="pt").to(
torch_device torch_device
) )
uncond_embeddings = self.bert(uncond_input.input_ids)[0] uncond_embeddings = self.bert(uncond_input.input_ids)
# get text embedding # get text embedding
text_input = self.tokenizer(prompt, padding="max_length", max_length=77, return_tensors="pt").to(torch_device) text_input = self.tokenizer(prompt, padding="max_length", max_length=77, return_tensors="pt").to(torch_device)
text_embedding = self.bert(text_input.input_ids)[0] text_embedding = self.bert(text_input.input_ids)
num_trained_timesteps = self.noise_scheduler.config.timesteps num_trained_timesteps = self.noise_scheduler.config.timesteps
inference_step_times = range(0, num_trained_timesteps, num_trained_timesteps // num_inference_steps) inference_step_times = range(0, num_trained_timesteps, num_trained_timesteps // num_inference_steps)