From 4e720aa333a924c5d15b2512e91f4ed447a82999 Mon Sep 17 00:00:00 2001 From: Ash Date: Thu, 26 Jan 2023 23:22:00 +0400 Subject: [PATCH] @1.2.4 fix context --- public/index.html | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/public/index.html b/public/index.html index e6214062e..30f87103b 100644 --- a/public/index.html +++ b/public/index.html @@ -666,22 +666,23 @@ //if (is_pygmalion && i == chat2.length-1) item='\n'+item; arrMes[arrMes.length] = item; }else{ - arrMes[arrMes.length-1] = '\n'+arrMes[arrMes.length-1]; i = chat.length-1; } - await delay(1); //For disable slow down (encode gpt-2 need fix) //console.log(i+' '+chat.length); if(i == chat.length-1){ + arrMes[arrMes.length-1] = '\n'+arrMes[arrMes.length-1]; let mesExmString = ''; - for(let iii = 0; iii < mesExamplesArray.length; iii++){//mesExamplesArray + let count_exm_add = 0; + for(let iii = 0; iii < mesExamplesArray.length; iii++){//mesExamplesArray It need to make from end to start + mesExmString = mesExmString+mesExamplesArray[iii]; if(encode(JSON.stringify(storyString+mesExmString+chatString+anchorTop+anchorBottom+charPersonality)).length+120 < this_max_context){ //example of dialogs if(!is_pygmalion){ mesExamplesArray[iii] = mesExamplesArray[iii].replace(//i, 'This is how '+name2+' should talk');//An example of how '+name2+' responds } - + count_exm_add++; await delay(1); //arrMes[arrMes.length] = item; @@ -691,7 +692,9 @@ } } - + for(let j = 0; j < count_exm_add; j++){ + storyString+=mesExamplesArray[j]; + } if(!is_pygmalion){ if(Scenario !== undefined){ if(Scenario.length > 0){