mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Merge pull request #244 from pi6am/fix/load-non-started
Fix loading a non-started V1 story json in UI2
This commit is contained in:
@@ -4816,6 +4816,11 @@ def actionsubmit(data, actionmode=0, force_submit=False, force_prompt_gen=False,
|
|||||||
execute_inmod()
|
execute_inmod()
|
||||||
koboldai_vars.submission = re.sub(r"[^\S\r\n]*([\r\n]*)$", r"\1", koboldai_vars.submission) # Remove trailing whitespace, excluding newlines
|
koboldai_vars.submission = re.sub(r"[^\S\r\n]*([\r\n]*)$", r"\1", koboldai_vars.submission) # Remove trailing whitespace, excluding newlines
|
||||||
data = koboldai_vars.submission
|
data = koboldai_vars.submission
|
||||||
|
if koboldai_vars.prompt:
|
||||||
|
# This will happen only when loading a non-started save game (i.e. one consisting only of a saved prompt).
|
||||||
|
# In this case, prepend the prompt to the sumission. This allows the player to submit a blank initial submission
|
||||||
|
# (preserving the prompt), or to add to the prompt by submitting non-empty data.
|
||||||
|
data = koboldai_vars.prompt + data
|
||||||
if(not force_submit and len(data.strip()) == 0):
|
if(not force_submit and len(data.strip()) == 0):
|
||||||
set_aibusy(0)
|
set_aibusy(0)
|
||||||
socketio.emit("error", "No prompt or random story theme entered", broadcast=True, room="UI_2")
|
socketio.emit("error", "No prompt or random story theme entered", broadcast=True, room="UI_2")
|
||||||
|
Reference in New Issue
Block a user