[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
1d3aa53d1f
commit
e6d775d0fc
2 changed files with 10 additions and 2 deletions
|
|
@ -341,7 +341,9 @@ def discover_image_caption_pairs(
|
|||
# 2. metadata row keyed by file name (basename or the relative path; as_posix so a
|
||||
# Windows backslash path still matches the jsonl's forward-slash keys).
|
||||
if caption is None:
|
||||
caption = meta_caption.get(img.name) or meta_caption.get(img.relative_to(root).as_posix())
|
||||
caption = meta_caption.get(img.name) or meta_caption.get(
|
||||
img.relative_to(root).as_posix()
|
||||
)
|
||||
# 3. dreambooth instance prompt.
|
||||
if caption is None and instance_prompt:
|
||||
caption = instance_prompt
|
||||
|
|
|
|||
|
|
@ -87,7 +87,13 @@ def _idle_state() -> dict[str, Any]:
|
|||
}
|
||||
|
||||
|
||||
def _append_metric(state: dict[str, Any], step: Any, loss: Any, lr: Any, grad_norm: Any = None) -> None:
|
||||
def _append_metric(
|
||||
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