mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2025-01-23 18:19:22 +01:00
Fix crash if missing instructions directory (#812)
This commit is contained in:
parent
3f3e42e26c
commit
641646a801
@ -55,7 +55,10 @@ def get_available_characters():
|
|||||||
return ['None'] + sorted(set((k.stem for k in paths if k.stem != "instruction-following")), key=str.lower)
|
return ['None'] + sorted(set((k.stem for k in paths if k.stem != "instruction-following")), key=str.lower)
|
||||||
|
|
||||||
def get_available_instruction_templates():
|
def get_available_instruction_templates():
|
||||||
paths = (x for x in Path('characters/instruction-following').iterdir() if x.suffix in ('.json', '.yaml', '.yml'))
|
path = "characters/instruction-following"
|
||||||
|
paths = []
|
||||||
|
if os.path.exists(path):
|
||||||
|
paths = (x for x in Path(path).iterdir() if x.suffix in ('.json', '.yaml', '.yml'))
|
||||||
return ['None'] + sorted(set((k.stem for k in paths)), key=str.lower)
|
return ['None'] + sorted(set((k.stem for k in paths)), key=str.lower)
|
||||||
|
|
||||||
def get_available_extensions():
|
def get_available_extensions():
|
||||||
|
Loading…
Reference in New Issue
Block a user