mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-10-30 06:00:15 +01:00
Clear instruction template before loading new one
This commit is contained in:
parent
36864cb3e8
commit
2b58a89f6a
@ -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"]:
|
||||
|
Loading…
Reference in New Issue
Block a user