Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -198,7 +198,7 @@ class AttentionReplace(AttentionControlEdit):
|
|
198 |
def __init__(self, prompts, num_steps: int, cross_replace_steps: float, self_replace_steps: float,
|
199 |
local_blend: Optional[LocalBlend] = None):
|
200 |
super(AttentionReplace, self).__init__(prompts, num_steps, cross_replace_steps, self_replace_steps, local_blend)
|
201 |
-
self.mapper = seq_aligner.get_replacement_mapper(prompts, tokenizer).to(device)
|
202 |
|
203 |
|
204 |
class AttentionRefine(AttentionControlEdit):
|
@@ -212,7 +212,7 @@ class AttentionRefine(AttentionControlEdit):
|
|
212 |
local_blend: Optional[LocalBlend] = None):
|
213 |
super(AttentionRefine, self).__init__(prompts, num_steps, cross_replace_steps, self_replace_steps, local_blend)
|
214 |
self.mapper, alphas = seq_aligner.get_refinement_mapper(prompts, tokenizer)
|
215 |
-
self.mapper, alphas = self.mapper.to(device)
|
216 |
self.alphas = alphas.reshape(alphas.shape[0], 1, 1, alphas.shape[1])
|
217 |
|
218 |
|
|
|
198 |
def __init__(self, prompts, num_steps: int, cross_replace_steps: float, self_replace_steps: float,
|
199 |
local_blend: Optional[LocalBlend] = None):
|
200 |
super(AttentionReplace, self).__init__(prompts, num_steps, cross_replace_steps, self_replace_steps, local_blend)
|
201 |
+
self.mapper = seq_aligner.get_replacement_mapper(prompts, tokenizer).to(device)
|
202 |
|
203 |
|
204 |
class AttentionRefine(AttentionControlEdit):
|
|
|
212 |
local_blend: Optional[LocalBlend] = None):
|
213 |
super(AttentionRefine, self).__init__(prompts, num_steps, cross_replace_steps, self_replace_steps, local_blend)
|
214 |
self.mapper, alphas = seq_aligner.get_refinement_mapper(prompts, tokenizer)
|
215 |
+
self.mapper, alphas = self.mapper.to(device), alphas.to(device).to(torch_dtype)
|
216 |
self.alphas = alphas.reshape(alphas.shape[0], 1, 1, alphas.shape[1])
|
217 |
|
218 |
|