k4d3 commited on
Commit
b7d52fe
1 Parent(s): d3c5f55

eat the new lines

Browse files
Files changed (1) hide show
  1. joy +3 -0
joy CHANGED
@@ -546,6 +546,9 @@ def main():
546
  if args.add_commas_to_sentence_ends:
547
  caption = re.sub(r"(\.)(\s+)([A-Z])", r"\1,\2\3", caption)
548
 
 
 
 
549
  print(f"Caption for {image_path}:\n\n{caption}\n\n")
550
 
551
  # Save the caption to a .caption file
 
546
  if args.add_commas_to_sentence_ends:
547
  caption = re.sub(r"(\.)(\s+)([A-Z])", r"\1,\2\3", caption)
548
 
549
+ # Remove all newline characters
550
+ caption = caption.replace("\n", " ")
551
+
552
  print(f"Caption for {image_path}:\n\n{caption}\n\n")
553
 
554
  # Save the caption to a .caption file