diff --git a/modules/chat.py b/modules/chat.py index 90231ace..a3d0d6e8 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -462,12 +462,17 @@ def load_character(character, name1, name2, instruct=False): greeting_field = 'greeting' picture = None - # Deleting the profile picture cache, if any + # Delete the profile picture cache, if any if Path("cache/pfp_character.png").exists() and not instruct: Path("cache/pfp_character.png").unlink() + if instruct: + name1 = name2 = '' + folder = 'instruction-templates' + else: + folder = 'characters' + if character not in ['None', '', None]: - folder = 'characters' if not instruct else 'instruction-templates' picture = generate_pfp_cache(character) filepath = None for extension in ["yml", "yaml", "json"]: