Organize chat history/character import menu (#2845)

* Organize character import menu

* Move Chat history upload/download labels
This commit is contained in:
missionfloyd 2023-06-24 06:55:02 -06:00 committed by GitHub
parent 8bb3bb39b3
commit 51a388fa34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 20 deletions

View file

@ -557,7 +557,6 @@ def upload_character(json_file, img, tavern=False):
f.write(json_file)
if img is not None:
img = Image.open(io.BytesIO(img))
img.save(Path(f'characters/{outfile_name}.png'))
logger.info(f'New character saved to "characters/{outfile_name}.json".')
@ -570,7 +569,7 @@ def upload_tavern_character(img, name1, name2):
decoded_string = base64.b64decode(_img.info['chara'])
_json = json.loads(decoded_string)
_json = {"char_name": _json['name'], "char_persona": _json['description'], "char_greeting": _json["first_mes"], "example_dialogue": _json['mes_example'], "world_scenario": _json['scenario']}
return upload_character(json.dumps(_json), img, tavern=True)
return upload_character(json.dumps(_json), _img, tavern=True)
def upload_your_profile_picture(img):