skytnt commited on
Commit
52a96e2
1 Parent(s): 3f924fb

Update pipeline.py

Browse files
Files changed (1) hide show
  1. pipeline.py +2 -2
pipeline.py CHANGED
@@ -340,7 +340,7 @@ def get_weighted_text_embeddings(
340
  pipe.tokenizer.model_max_length,
341
  no_boseos_middle=no_boseos_middle,
342
  )
343
- prompt_weights = torch.tensor(prompt_weights, dtype=text_embeddings.dtype, device=pipe.device)
344
  if uncond_prompt is not None:
345
  uncond_embeddings = get_unweighted_text_embeddings(
346
  pipe,
@@ -348,7 +348,7 @@ def get_weighted_text_embeddings(
348
  pipe.tokenizer.model_max_length,
349
  no_boseos_middle=no_boseos_middle,
350
  )
351
- uncond_weights = torch.tensor(uncond_weights, dtype=uncond_embeddings.dtype, device=pipe.device)
352
 
353
  # assign weights to the prompts and normalize in the sense of mean
354
  # TODO: should we normalize by chunk or in a whole (current implementation)?
 
340
  pipe.tokenizer.model_max_length,
341
  no_boseos_middle=no_boseos_middle,
342
  )
343
+ prompt_weights = torch.tensor(prompt_weights, dtype=text_embeddings.dtype, device=text_embeddings.device)
344
  if uncond_prompt is not None:
345
  uncond_embeddings = get_unweighted_text_embeddings(
346
  pipe,
 
348
  pipe.tokenizer.model_max_length,
349
  no_boseos_middle=no_boseos_middle,
350
  )
351
+ uncond_weights = torch.tensor(uncond_weights, dtype=uncond_embeddings.dtype, device=uncond_embeddings.device)
352
 
353
  # assign weights to the prompts and normalize in the sense of mean
354
  # TODO: should we normalize by chunk or in a whole (current implementation)?