mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-02-25 16:08:00 +01:00
</s> new line mode
Needed for Fairseq and XGLM models that do not understand the regular \n .
This commit is contained in:
parent
44d49ea732
commit
729be62821
12
aiserver.py
12
aiserver.py
@ -201,6 +201,7 @@ class vars:
|
||||
rngpersist = False
|
||||
nogenmod = False
|
||||
welcome = False # Custom Welcome Text (False is default)
|
||||
newlinemode = "n"
|
||||
|
||||
#==================================================================#
|
||||
# Function to get model selection at startup
|
||||
@ -427,6 +428,8 @@ def loadmodelsettings():
|
||||
vars.formatoptns = js["formatoptns"]
|
||||
if("welcome" in js):
|
||||
vars.welcome = js["welcome"]
|
||||
if("newlinemode" in js):
|
||||
vars.newlinemode = js["newlinemode"]
|
||||
if("antemplate" in js):
|
||||
vars.setauthornotetemplate = js["antemplate"]
|
||||
if(not vars.gamestarted):
|
||||
@ -2236,6 +2239,7 @@ def savesettings():
|
||||
js["userscripts"] = vars.userscripts
|
||||
js["corescript"] = vars.corescript
|
||||
js["softprompt"] = vars.spfilename
|
||||
js["newlinemode"] = vars.newlinemode
|
||||
|
||||
# Write it
|
||||
if not os.path.exists('settings'):
|
||||
@ -2304,6 +2308,8 @@ def loadsettings():
|
||||
vars.nogenmod = js["nogenmod"]
|
||||
if("autosave" in js):
|
||||
vars.autosave = js["autosave"]
|
||||
if("newlinemode" in js):
|
||||
vars.newlinemode = js["newlinemode"]
|
||||
|
||||
if("antemplate" in js):
|
||||
vars.setauthornotetemplate = js["antemplate"]
|
||||
@ -2369,6 +2375,12 @@ def actionsubmit(data, actionmode=0, force_submit=False, force_prompt_gen=False,
|
||||
if(vars.aibusy):
|
||||
return
|
||||
|
||||
# </s> mode
|
||||
if(vars.newlinemode == "s"):
|
||||
print("S mode activated")
|
||||
data = data.replace('\n', "</s>")
|
||||
print(data)
|
||||
|
||||
while(True):
|
||||
set_aibusy(1)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user