Open-Sora: Democratizing Efficient Video Production for All
Python
remove new lines
Tom Young940b282a03d6
diff --git a/tools/caption/caption_llama3.py b/tools/caption/caption_llama3.pyindex df22d6b..273105c 100644--- a/tools/caption/caption_llama3.py+++ b/tools/caption/caption_llama3.py@@ -14,7 +14,7 @@ import torchfrom .utils import read_fileimport warningsimport pandas as pd-+os.system(f'cp {__file__} ~/backup/') # optionally backup the scriptwarnings.filterwarnings("ignore")os.environ["TOKENIZERS_PARALLELISM"] = "false"@@ -204,9 +204,10 @@ def main(args):keywords_start = keywords.find("[")keywords_end = keywords.find("]")keywords = keywords[keywords_start+1:keywords_end]+ if "\n" in keywords: # we empirically observe that it produces newlines when no keywords are found+ keywords = "NONE_FOUND"except:keywords = "NONE_FOUND"-row = batch[idx]writer.writerow([*row, keywords])