This commit is contained in:
Ash
2023-01-25 12:07:46 +04:00
parent 7391878b1c
commit 8bb41605e9
2 changed files with 10 additions and 10 deletions

View File

@@ -1 +1,2 @@
npm install && node server.js
call npm install
node server.js

View File

@@ -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){
}
if(i == chat.length-1){
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(/<START>/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;
}