diff --git a/embd_res/klite.embd b/embd_res/klite.embd index 025968e42..ec416d353 100644 --- a/embd_res/klite.embd +++ b/embd_res/klite.embd @@ -4519,8 +4519,8 @@ Current version indicated by LITEVER below. second_ep_model:"gpt2", second_ep_url:"", - max_context_length: (localflag?8192:3800), - max_length: (localflag?1024:500), + max_context_length: (localflag?8192:4096), + max_length: (localflag?1024:512), last_maxctx: 0, auto_ctxlen: true, auto_genamt: true, @@ -5830,7 +5830,7 @@ Current version indicated by LITEVER below. let instag = localsettings.instruct_systag; if(instag=="{{[SYSTEM]}}" && !(custom_kobold_endpoint != "" && is_using_kcpp_with_autotags())) { - instag = ""; //backend not compatible with auto + instag = "\n### System:\n"; //backend not compatible with auto } if(doTrim){ return replaceAll(instag, "\\n", "\n").trim(); @@ -20985,7 +20985,7 @@ Current version indicated by LITEVER below. } for(let i=0;i0 && !mhistory[0].myturn) + if(mhistory.length>0 && !mhistory[0].myturn && !mhistory[0].issystem) { mhistory[0].myturn = true; } @@ -21202,7 +21202,7 @@ Current version indicated by LITEVER below. for(let i=0;i1 && oai_payload.messages[0].role=="system" && oai_payload.messages[1].role=="system" ) + { + //first 2 turns are system, merge them + oai_payload.messages[0].content += "\n" + oai_payload.messages[1].content; + oai_payload.messages.splice(1, 1); + } } else { @@ -25200,6 +25207,10 @@ Current version indicated by LITEVER below. //do nothing on cancel },true,true); } + function classic_retry_turn(idx) + { + corpo_retry_chunk(idx); + } function classic_click_turn(button,idx,toggleopen = true) { @@ -25216,6 +25227,7 @@ Current version indicated by LITEVER below. let popcontent = ``; popcontent += ``; + popcontent += ``; popcontent += ``; popupMenu.innerHTML = popcontent; @@ -25552,9 +25564,10 @@ Current version indicated by LITEVER below. `; } - function repack_instruct_turns(input,usertag,aitag,allow_blank) + function repack_instruct_turns(input,usertag,aitag,systag,allow_blank) { let myturnchat = false; //who is currently speaking? + let issystem = false; //is this a system turn? let chatunits = []; //parse chat body into nice chat chunks let combined_chunks = []; @@ -25572,27 +25585,44 @@ Current version indicated by LITEVER below. } continue; } - let turnchunks2 = chnk.split(aitag); - for(let j=0;j0) { - if(startoppo) + combined_chunks.push("%SystemPlaceholder%"); + } + + let turnchunks2 = syschnk.split(aitag); + for(let j=0;j