mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Retrying random story generation now also remembers memory
This commit is contained in:
@@ -163,6 +163,7 @@ class vars:
|
|||||||
genseqs = [] # Temporary storage for generated sequences
|
genseqs = [] # Temporary storage for generated sequences
|
||||||
recentback = False # Whether Back button was recently used without Submitting or Retrying after
|
recentback = False # Whether Back button was recently used without Submitting or Retrying after
|
||||||
recentrng = None # If a new random game was recently generated without Submitting after, this is the topic used (as a string), otherwise this is None
|
recentrng = None # If a new random game was recently generated without Submitting after, this is the topic used (as a string), otherwise this is None
|
||||||
|
recentrngm = None # If a new random game was recently generated without Submitting after, this is the memory used (as a string), otherwise this is None
|
||||||
useprompt = False # Whether to send the full prompt with every submit action
|
useprompt = False # Whether to send the full prompt with every submit action
|
||||||
breakmodel = False # For GPU users, whether to use both system RAM and VRAM to conserve VRAM while offering speedup compared to CPU-only
|
breakmodel = False # For GPU users, whether to use both system RAM and VRAM to conserve VRAM while offering speedup compared to CPU-only
|
||||||
bmsupported = False # Whether the breakmodel option is supported (GPT-Neo/GPT-J only, currently)
|
bmsupported = False # Whether the breakmodel option is supported (GPT-Neo/GPT-J only, currently)
|
||||||
@@ -1645,7 +1646,7 @@ def get_message(msg):
|
|||||||
vars.chatname = msg['chatname']
|
vars.chatname = msg['chatname']
|
||||||
settingschanged()
|
settingschanged()
|
||||||
emit('from_server', {'cmd': 'setchatname', 'data': vars.chatname}, broadcast=True)
|
emit('from_server', {'cmd': 'setchatname', 'data': vars.chatname}, broadcast=True)
|
||||||
vars.recentrng = None
|
vars.recentrng = vars.recentrngm = None
|
||||||
actionsubmit(msg['data'], actionmode=msg['actionmode'])
|
actionsubmit(msg['data'], actionmode=msg['actionmode'])
|
||||||
elif(vars.mode == "edit"):
|
elif(vars.mode == "edit"):
|
||||||
editsubmit(msg['data'])
|
editsubmit(msg['data'])
|
||||||
@@ -2130,7 +2131,7 @@ def actionsubmit(data, actionmode=0, force_submit=False, force_prompt_gen=False,
|
|||||||
set_aibusy(1)
|
set_aibusy(1)
|
||||||
|
|
||||||
if(disable_recentrng):
|
if(disable_recentrng):
|
||||||
vars.recentrng = None
|
vars.recentrng = vars.recentrngm = None
|
||||||
|
|
||||||
vars.recentback = False
|
vars.recentback = False
|
||||||
vars.recentedit = False
|
vars.recentedit = False
|
||||||
@@ -2272,7 +2273,7 @@ def actionretry(data):
|
|||||||
if(vars.aibusy):
|
if(vars.aibusy):
|
||||||
return
|
return
|
||||||
if(vars.recentrng is not None):
|
if(vars.recentrng is not None):
|
||||||
randomGameRequest(vars.recentrng)
|
randomGameRequest(vars.recentrng, memory=vars.recentrngm)
|
||||||
return
|
return
|
||||||
# Remove last action if possible and resubmit
|
# Remove last action if possible and resubmit
|
||||||
if(vars.gamestarted if vars.useprompt else len(vars.actions) > 0):
|
if(vars.gamestarted if vars.useprompt else len(vars.actions) > 0):
|
||||||
@@ -4282,6 +4283,7 @@ def randomGameRequest(topic, memory=""):
|
|||||||
newGameRequest()
|
newGameRequest()
|
||||||
return
|
return
|
||||||
vars.recentrng = topic
|
vars.recentrng = topic
|
||||||
|
vars.recentrngm = memory
|
||||||
newGameRequest()
|
newGameRequest()
|
||||||
_memory = memory
|
_memory = memory
|
||||||
if(len(memory) > 0):
|
if(len(memory) > 0):
|
||||||
|
Reference in New Issue
Block a user