Move characters/instruction-following to instruction-templates
This commit is contained in:
parent
65aa11890f
commit
c237ce607e
59 changed files with 10 additions and 10 deletions
|
|
@ -475,7 +475,7 @@ def load_character(character, name1, name2, instruct=False):
|
|||
Path("cache/pfp_character.png").unlink()
|
||||
|
||||
if character not in ['None', '', None]:
|
||||
folder = 'characters' if not instruct else 'characters/instruction-following'
|
||||
folder = 'characters' if not instruct else 'instruction-templates'
|
||||
picture = generate_pfp_cache(character)
|
||||
filepath = None
|
||||
for extension in ["yml", "yaml", "json"]:
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ def load_prompt(fname):
|
|||
return ''
|
||||
elif fname.startswith('Instruct-'):
|
||||
fname = re.sub('^Instruct-', '', fname)
|
||||
file_path = Path(f'characters/instruction-following/{fname}.yaml')
|
||||
file_path = Path(f'instruction-templates/{fname}.yaml')
|
||||
if not file_path.exists():
|
||||
return ''
|
||||
|
||||
|
|
|
|||
|
|
@ -232,13 +232,13 @@ def create_event_handlers():
|
|||
|
||||
shared.gradio['save_template'].click(
|
||||
lambda: 'My Template.yaml', None, gradio('save_filename')).then(
|
||||
lambda: 'characters/instruction-following/', None, gradio('save_root')).then(
|
||||
lambda: 'instruction-templates/', None, gradio('save_root')).then(
|
||||
chat.generate_instruction_template_yaml, gradio('name1_instruct', 'name2_instruct', 'context_instruct', 'turn_template'), gradio('save_contents')).then(
|
||||
lambda: gr.update(visible=True), None, gradio('file_saver'))
|
||||
|
||||
shared.gradio['delete_template'].click(
|
||||
lambda x: f'{x}.yaml', gradio('instruction_template'), gradio('delete_filename')).then(
|
||||
lambda: 'characters/instruction-following/', None, gradio('delete_root')).then(
|
||||
lambda: 'instruction-templates/', None, gradio('delete_root')).then(
|
||||
lambda: gr.update(visible=True), None, gradio('file_deleter'))
|
||||
|
||||
shared.gradio['save_chat_history'].click(
|
||||
|
|
|
|||
|
|
@ -90,11 +90,11 @@ def get_available_prompts():
|
|||
|
||||
def get_available_characters():
|
||||
paths = (x for x in Path('characters').iterdir() if x.suffix in ('.json', '.yaml', '.yml'))
|
||||
return ['None'] + sorted(set((k.stem for k in paths if k.stem != "instruction-following")), key=natural_keys)
|
||||
return ['None'] + sorted(set((k.stem for k in paths)), key=natural_keys)
|
||||
|
||||
|
||||
def get_available_instruction_templates():
|
||||
path = "characters/instruction-following"
|
||||
path = "instruction-templates"
|
||||
paths = []
|
||||
if os.path.exists(path):
|
||||
paths = (x for x in Path(path).iterdir() if x.suffix in ('.json', '.yaml', '.yml'))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue