Use YAML for presets and settings
This commit is contained in:
parent
2cf711f35e
commit
00ebea0b2a
42 changed files with 155 additions and 169 deletions
|
|
@ -641,7 +641,7 @@ def save_character(name, greeting, context, picture, filename, instruct=False):
|
|||
data = {k: v for k, v in data.items() if v} # Strip falsy
|
||||
filepath = Path(f'{folder}/{filename}.yaml')
|
||||
with filepath.open('w') as f:
|
||||
yaml.dump(data, f)
|
||||
yaml.dump(data, f, sort_keys=False)
|
||||
|
||||
logger.info(f'Wrote {filepath}')
|
||||
path_to_img = Path(f'{folder}/{filename}.png')
|
||||
|
|
|
|||
|
|
@ -65,18 +65,9 @@ settings = {
|
|||
'chat_generation_attempts_min': 1,
|
||||
'chat_generation_attempts_max': 10,
|
||||
'default_extensions': [],
|
||||
'chat_default_extensions': ["gallery"],
|
||||
'presets': {
|
||||
'default': 'Default',
|
||||
'.*(alpaca|llama|llava|vicuna)': "LLaMA-Precise",
|
||||
'.*pygmalion': 'NovelAI-Storywriter',
|
||||
'.*RWKV.*\.pth': 'Naive',
|
||||
'.*moss': 'MOSS',
|
||||
},
|
||||
'prompts': {
|
||||
'default': 'QA',
|
||||
'.*(gpt4chan|gpt-4chan|4chan)': 'GPT-4chan',
|
||||
}
|
||||
'chat_default_extensions': ['gallery'],
|
||||
'preset': 'LLaMA-Precise',
|
||||
'prompt': 'QA',
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -103,7 +94,7 @@ parser.add_argument("--model-dir", type=str, default='models/', help="Path to di
|
|||
parser.add_argument("--lora-dir", type=str, default='loras/', help="Path to directory with all the loras")
|
||||
parser.add_argument('--model-menu', action='store_true', help='Show a model menu in the terminal when the web UI is first launched.')
|
||||
parser.add_argument('--no-stream', action='store_true', help='Don\'t stream the text output in real time.')
|
||||
parser.add_argument('--settings', type=str, help='Load the default interface settings from this json file. See settings-template.json for an example. If you create a file called settings.json, this file will be loaded by default without the need to use the --settings flag.')
|
||||
parser.add_argument('--settings', type=str, help='Load the default interface settings from this yaml file. See settings-template.yaml for an example. If you create a file called settings.yaml, this file will be loaded by default without the need to use the --settings flag.')
|
||||
parser.add_argument('--extensions', type=str, nargs="+", help='The list of extensions to load. If you want to load more than one extension, write the names separated by spaces.')
|
||||
parser.add_argument('--verbose', action='store_true', help='Print the prompts to the terminal.')
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ def get_available_models():
|
|||
|
||||
|
||||
def get_available_presets():
|
||||
return sorted(set((k.stem for k in Path('presets').glob('*.txt'))), key=natural_keys)
|
||||
return sorted(set((k.stem for k in Path('presets').glob('*.yaml'))), key=natural_keys)
|
||||
|
||||
|
||||
def get_available_prompts():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue