mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-26 01:30:20 +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'
|
greeting_field = 'greeting'
|
||||||
picture = None
|
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:
|
if Path("cache/pfp_character.png").exists() and not instruct:
|
||||||
Path("cache/pfp_character.png").unlink()
|
Path("cache/pfp_character.png").unlink()
|
||||||
|
|
||||||
|
if instruct:
|
||||||
|
name1 = name2 = ''
|
||||||
|
folder = 'instruction-templates'
|
||||||
|
else:
|
||||||
|
folder = 'characters'
|
||||||
|
|
||||||
if character not in ['None', '', None]:
|
if character not in ['None', '', None]:
|
||||||
folder = 'characters' if not instruct else 'instruction-templates'
|
|
||||||
picture = generate_pfp_cache(character)
|
picture = generate_pfp_cache(character)
|
||||||
filepath = None
|
filepath = None
|
||||||
for extension in ["yml", "yaml", "json"]:
|
for extension in ["yml", "yaml", "json"]:
|
||||||
|
Loading…
Reference in New Issue
Block a user