Merge pre-commit formatting into diffusion-train-tab-2
This commit is contained in:
commit
4215035a83
2 changed files with 6 additions and 4 deletions
|
|
@ -512,9 +512,7 @@ def run_diffusion_lora_training(
|
|||
grad_norm = None
|
||||
if cfg.max_grad_norm and cfg.max_grad_norm > 0:
|
||||
# The returned value is the total PRE-clip norm, reported to the UI chart.
|
||||
grad_norm = float(
|
||||
torch.nn.utils.clip_grad_norm_(lora_params, cfg.max_grad_norm)
|
||||
)
|
||||
grad_norm = float(torch.nn.utils.clip_grad_norm_(lora_params, cfg.max_grad_norm))
|
||||
optimizer.step()
|
||||
lr_sched.step()
|
||||
|
||||
|
|
|
|||
|
|
@ -139,7 +139,11 @@ def _idle_state() -> dict[str, Any]:
|
|||
|
||||
|
||||
def _append_metric(
|
||||
state: dict[str, Any], step: Any, loss: Any, lr: Any, grad_norm: Any = None
|
||||
state: dict[str, Any],
|
||||
step: Any,
|
||||
loss: Any,
|
||||
lr: Any,
|
||||
grad_norm: Any = None,
|
||||
) -> None:
|
||||
"""Append one (step, loss, lr, grad_norm) point to the bounded history arrays on
|
||||
``state``.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue