From 8bb41605e936e9b0268760f110fb0b2a8654aa19 Mon Sep 17 00:00:00 2001 From: Ash Date: Wed, 25 Jan 2023 12:07:46 +0400 Subject: [PATCH] fix --- Start.bat | 3 ++- public/index.html | 17 ++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Start.bat b/Start.bat index bcdaf807b..bb8b25d0a 100644 --- a/Start.bat +++ b/Start.bat @@ -1 +1,2 @@ -npm install && node server.js \ No newline at end of file +call npm install +node server.js \ No newline at end of file diff --git a/public/index.html b/public/index.html index bc6f60721..cc5203736 100644 --- a/public/index.html +++ b/public/index.html @@ -620,6 +620,7 @@ } + var chat2 = []; var j = 0; for(var i = chat.length-1; i >= 0; i--){ @@ -663,11 +664,11 @@ } await delay(1); //For disable slow down (encode gpt-2 need fix) //console.log(i+' '+chat.length); + if(i == chat.length-1){ - if(mesExamplesArray.length > 0){ - - } + for(let iii = 0; iii < mesExamplesArray.length; iii++){//mesExamplesArray + if(encode(JSON.stringify(storyString+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 @@ -677,10 +678,12 @@ //arrMes[arrMes.length] = item; }else{ - return; + + iii = mesExamplesArray.length; } } + if(!is_pygmalion){ if(Scenario !== undefined){ if(Scenario.length > 0){ @@ -697,6 +700,7 @@ } function runGenerate(cycleGenerationPromt = ''){ + if(cycleGenerationPromt === ''){ chatString = ""; @@ -857,11 +861,6 @@ message_already_generated +=getMessage; if(message_already_generated.indexOf('You:') === -1 && tokens_already_generated < parseInt(amount_gen)){ - if(tokens_already_generated === 0){ - getMessage = getMessage.trimStart(); - getMessage = ' '+getMessage; - } - runGenerate(storyString+getMessage); return; }