Fix newlines in exported character yamls

This commit is contained in:
oobabooga 2023-07-31 10:46:02 -07:00
parent d06c34dea5
commit 7de7b3d495

View File

@ -598,7 +598,7 @@ def check_tavern_character(img):
if "chara" not in img.info: if "chara" not in img.info:
return "Not a TavernAI card", None, None, gr.update(interactive=False) return "Not a TavernAI card", None, None, gr.update(interactive=False)
decoded_string = base64.b64decode(img.info['chara']) decoded_string = base64.b64decode(img.info['chara']).replace(b'\\r\\n', b'\\n')
_json = json.loads(decoded_string) _json = json.loads(decoded_string)
if "data" in _json: if "data" in _json:
_json = _json["data"] _json = _json["data"]