mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
speedup
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
|||||||
version = '2.1.773'
|
version = '2.1.774'
|
||||||
|
|||||||
@@ -75,9 +75,12 @@ class FooocusExpansion:
|
|||||||
@torch.inference_mode()
|
@torch.inference_mode()
|
||||||
def logits_processor(self, input_ids, scores):
|
def logits_processor(self, input_ids, scores):
|
||||||
assert scores.ndim == 2 and scores.shape[0] == 1
|
assert scores.ndim == 2 and scores.shape[0] == 1
|
||||||
bias = self.logits_bias.to(scores).clone()
|
self.logits_bias = self.logits_bias.to(scores)
|
||||||
|
|
||||||
|
bias = self.logits_bias.clone()
|
||||||
bias[0, input_ids[0].to(bias.device).long()] = neg_inf
|
bias[0, input_ids[0].to(bias.device).long()] = neg_inf
|
||||||
bias[0, 11] = 0
|
bias[0, 11] = 0
|
||||||
|
|
||||||
return scores + bias
|
return scores + bias
|
||||||
|
|
||||||
@torch.no_grad()
|
@torch.no_grad()
|
||||||
|
|||||||
Reference in New Issue
Block a user