mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Added save overwrite, download as json, and fixed some css properties
This commit is contained in:
@@ -365,7 +365,7 @@ class story_settings(settings):
|
||||
|
||||
def save_story(self):
|
||||
print("Saving")
|
||||
save_name = self.story_name if self.story_name is not "" else "untitled"
|
||||
save_name = self.story_name if self.story_name != "" else "untitled"
|
||||
with open("stories/{}_v2.json".format(save_name), "w") as settings_file:
|
||||
settings_file.write(self.to_json())
|
||||
self.gamesaved = True
|
||||
@@ -387,8 +387,16 @@ class story_settings(settings):
|
||||
if name == "gamesaved" and value == False and self.autosave:
|
||||
self.save_story()
|
||||
if not new_variable and old_value != value:
|
||||
#Change game save state
|
||||
if name in ['story_name', 'prompt', 'memory', 'authornote', 'authornotetemplate', 'andepth', 'chatname', 'actionmode', 'dynamicscan', 'notes', 'biases']:
|
||||
self.gamesaved = False
|
||||
|
||||
if name == 'actions':
|
||||
self.actions.story_settings = self
|
||||
elif name == 'story_name':
|
||||
#reset the story id if we change the name
|
||||
self.story_id = int.from_bytes(os.urandom(16), 'little', signed=True)
|
||||
|
||||
#Recalc token length
|
||||
elif name in ['authornote', 'memory' ,'prompt', 'tokenizer'] and self.tokenizer is not None:
|
||||
if name == 'tokenizer' and not new_variable:
|
||||
|
Reference in New Issue
Block a user