From 3af3ffeb90db8b62cb77873240445731bb5cd579 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Thu, 2 Feb 2023 23:36:28 -0300 Subject: [PATCH] Make --help output more readable --- server.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server.py b/server.py index fb99bf5d..71356330 100644 --- a/server.py +++ b/server.py @@ -23,7 +23,7 @@ from modules.stopping_criteria import _SentinelTokenStoppingCriteria transformers.logging.set_verbosity_error() -parser = argparse.ArgumentParser() +parser = argparse.ArgumentParser(formatter_class=lambda prog: argparse.HelpFormatter(prog,max_help_position=54)) parser.add_argument('--model', type=str, help='Name of the model to load by default.') parser.add_argument('--notebook', action='store_true', help='Launch the web UI in notebook mode, where the output is written to the same text box as the input.') parser.add_argument('--chat', action='store_true', help='Launch the web UI in chat mode.') @@ -136,8 +136,7 @@ def load_model(model_name): if args.disk: settings.append(f"offload_folder='{args.disk_cache_dir or 'cache'}'") - settings = ', '.join(set(settings)) - command = f"{command}(Path(f'models/{model_name}'), {settings})" + command = f"{command}(Path(f'models/{model_name}'), {','.join(set(settings))})" model = eval(command) # Loading the tokenizer