accept empty caption #258

This commit is contained in:
Kohya S
2023-03-07 08:23:34 +09:00
parent 8d5ba29363
commit 225c533279

View File

@@ -924,7 +924,9 @@ class FineTuningDataset(BaseDataset):
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')