mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-06 13:47:06 +00:00
Fix to show template type
This commit is contained in:
@@ -94,7 +94,7 @@ class TextualInversionTrainer:
|
||||
|
||||
def assert_token_string(self, token_string, tokenizers):
|
||||
pass
|
||||
|
||||
|
||||
def get_text_cond(self, args, accelerator, batch, tokenizers, text_encoders, weight_dtype):
|
||||
with torch.enable_grad():
|
||||
input_ids = batch["input_ids"].to(accelerator.device)
|
||||
@@ -311,7 +311,7 @@ class TextualInversionTrainer:
|
||||
|
||||
# make captions: tokenstring tokenstring1 tokenstring2 ...tokenstringn という文字列に書き換える超乱暴な実装
|
||||
if use_template:
|
||||
accelerator.print("use template for training captions. is object: {args.use_object_template}")
|
||||
accelerator.print(f"use template for training captions. is object: {args.use_object_template}")
|
||||
templates = imagenet_templates_small if args.use_object_template else imagenet_style_templates_small
|
||||
replace_to = " ".join(token_strings)
|
||||
captions = []
|
||||
|
||||
@@ -234,7 +234,7 @@ def train(args):
|
||||
|
||||
# make captions: tokenstring tokenstring1 tokenstring2 ...tokenstringn という文字列に書き換える超乱暴な実装
|
||||
if use_template:
|
||||
print("use template for training captions. is object: {args.use_object_template}")
|
||||
print(f"use template for training captions. is object: {args.use_object_template}")
|
||||
templates = imagenet_templates_small if args.use_object_template else imagenet_style_templates_small
|
||||
replace_to = " ".join(token_strings)
|
||||
captions = []
|
||||
|
||||
Reference in New Issue
Block a user