Skip to content

Commit

Permalink
accept empty caption #258
Browse files Browse the repository at this point in the history
  • Loading branch information
kohya-ss committed Mar 6, 2023
1 parent 8d5ba29 commit 225c533
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion library/train_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,9 @@ def __init__(self, subsets: Sequence[FineTuningSubset], batch_size: int, tokeniz
elif tags is not None and len(tags) > 0:
caption = caption + ', ' + tags
tags_list.append(tags)
assert caption is not None and len(caption) > 0, f"caption or tag is required / キャプションまたはタグは必須です:{abs_path}"

if caption is None:
caption = ""

image_info = ImageInfo(image_key, subset.num_repeats, caption, False, abs_path)
image_info.image_size = img_md.get('train_resolution')
Expand Down

0 comments on commit 225c533

Please sign in to comment.