mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-10-01 01:26:03 -04:00
Small patch to fix loading of character jsons. Now it correctly reads non-ascii characters on Windows.
This commit is contained in:
parent
195e99d0b6
commit
def97f658c
@ -332,7 +332,7 @@ def load_character(_character, name1, name2):
|
||||
shared.history['visible'] = []
|
||||
if _character != 'None':
|
||||
shared.character = _character
|
||||
data = json.loads(open(Path(f'characters/{_character}.json'), 'r').read())
|
||||
data = json.loads(open(Path(f'characters/{_character}.json'), 'r', encoding='utf-8').read())
|
||||
name2 = data['char_name']
|
||||
if 'char_persona' in data and data['char_persona'] != '':
|
||||
context += f"{data['char_name']}'s Persona: {data['char_persona']}\n"
|
||||
|
Loading…
Reference in New Issue
Block a user