Allow users to write one flag per line in CMD_FLAGS.txt

This commit is contained in:
oobabooga 2023-08-09 01:58:23 -03:00 committed by GitHub
parent 9e17325207
commit fa4a948b38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,7 +18,8 @@ if "OOBABOOGA_FLAGS" in os.environ:
else:
cmd_flags_path = os.path.join(script_dir, "CMD_FLAGS.txt")
if os.path.exists(cmd_flags_path):
CMD_FLAGS = open(cmd_flags_path, 'r').read().strip()
with open(cmd_flags_path, 'r') as f:
CMD_FLAGS = ' '.join(line.strip() for line in f.read().splitlines() if line.strip())
else:
CMD_FLAGS = '--chat'