mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-30 03:18:57 +01:00
Make --help output more readable
This commit is contained in:
parent
638495b633
commit
3af3ffeb90
@ -23,7 +23,7 @@ from modules.stopping_criteria import _SentinelTokenStoppingCriteria
|
|||||||
|
|
||||||
transformers.logging.set_verbosity_error()
|
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('--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('--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.')
|
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:
|
if args.disk:
|
||||||
settings.append(f"offload_folder='{args.disk_cache_dir or 'cache'}'")
|
settings.append(f"offload_folder='{args.disk_cache_dir or 'cache'}'")
|
||||||
|
|
||||||
settings = ', '.join(set(settings))
|
command = f"{command}(Path(f'models/{model_name}'), {','.join(set(settings))})"
|
||||||
command = f"{command}(Path(f'models/{model_name}'), {settings})"
|
|
||||||
model = eval(command)
|
model = eval(command)
|
||||||
|
|
||||||
# Loading the tokenizer
|
# Loading the tokenizer
|
||||||
|
Loading…
Reference in New Issue
Block a user