summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--train_ti.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/train_ti.py b/train_ti.py
index dbfe58c..5c0299e 100644
--- a/train_ti.py
+++ b/train_ti.py
@@ -648,7 +648,11 @@ def main():
648 weight_dtype = torch.bfloat16 648 weight_dtype = torch.bfloat16
649 649
650 def keyword_filter(item: CSVDataItem): 650 def keyword_filter(item: CSVDataItem):
651 return any(keyword in item.prompt for keyword in args.placeholder_token) 651 return any(
652 keyword in part
653 for keyword in args.placeholder_token
654 for part in item.prompt
655 )
652 656
653 def collate_fn(examples): 657 def collate_fn(examples):
654 prompts = [example["prompts"] for example in examples] 658 prompts = [example["prompts"] for example in examples]