Update pipeline.py
Browse files- 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=
|
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=
|
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)?
|