mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-26 01:30:20 +01:00
Add default extensions to the settings
This commit is contained in:
parent
365e1089b3
commit
a1429d1607
@ -39,6 +39,8 @@ settings = {
|
|||||||
'name2_pygmalion': 'Kawaii',
|
'name2_pygmalion': 'Kawaii',
|
||||||
'context_pygmalion': "Kawaii's persona: Kawaii is a cheerful person who loves to make others smile. She is an optimist who loves to spread happiness and positivity wherever she goes.\n<START>",
|
'context_pygmalion': "Kawaii's persona: Kawaii is a cheerful person who loves to make others smile. She is an optimist who loves to spread happiness and positivity wherever she goes.\n<START>",
|
||||||
'stop_at_newline_pygmalion': False,
|
'stop_at_newline_pygmalion': False,
|
||||||
|
'default_extensions': [],
|
||||||
|
'chat_default_extensions': ["gallery"],
|
||||||
}
|
}
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(formatter_class=lambda prog: argparse.HelpFormatter(prog,max_help_position=54))
|
parser = argparse.ArgumentParser(formatter_class=lambda prog: argparse.HelpFormatter(prog,max_help_position=54))
|
||||||
|
13
server.py
13
server.py
@ -151,7 +151,18 @@ available_characters = get_available_characters()
|
|||||||
available_softprompts = get_available_softprompts()
|
available_softprompts = get_available_softprompts()
|
||||||
|
|
||||||
extensions_module.available_extensions = get_available_extensions()
|
extensions_module.available_extensions = get_available_extensions()
|
||||||
if shared.args.extensions is not None:
|
# Activate the default extensions
|
||||||
|
if shared.args.chat or shared.args.cai_chat:
|
||||||
|
for extension in shared.settings['chat_default_extensions']:
|
||||||
|
shared.args.extensions = shared.args.extensions or []
|
||||||
|
if extension not in shared.args.extensions:
|
||||||
|
shared.args.extensions.append(extension)
|
||||||
|
else:
|
||||||
|
for extension in shared.settings['default_extensions']:
|
||||||
|
shared.args.extensions = shared.args.extensions or []
|
||||||
|
if extension not in shared.args.extensions:
|
||||||
|
shared.args.extensions.append(extension)
|
||||||
|
if shared.args.extensions is not None and len(shared.args.extensions) > 0:
|
||||||
extensions_module.load_extensions()
|
extensions_module.load_extensions()
|
||||||
|
|
||||||
# Choosing the default model
|
# Choosing the default model
|
||||||
|
Loading…
Reference in New Issue
Block a user