Added training for an experimental decoratgor embedding. Allow for turning off guidance embedding on flux (for unreleased model). Various bug fixes and modifications

This commit is contained in:
Jaret Burkett
2024-12-15 08:59:27 -07:00
parent 92ce93140e
commit 8ef07a9c36
11 changed files with 182 additions and 10 deletions

View File

@@ -264,6 +264,10 @@ class Adafactor(torch.optim.Optimizer):
if grad.is_sparse:
raise RuntimeError(
"Adafactor does not support sparse gradients.")
# if p has atts _scale then it is quantized. We need to divide the grad by the scale
# if hasattr(p, "_scale"):
# grad = grad / p._scale
state = self.state[p]
grad_shape = grad.shape