diff --git a/public/KoboldAI Settings/Calibrated-Pygmalion-6b.settings b/public/KoboldAI Settings/Calibrated-Pygmalion-6b.settings new file mode 100644 index 000000000..1cab01223 --- /dev/null +++ b/public/KoboldAI Settings/Calibrated-Pygmalion-6b.settings @@ -0,0 +1,47 @@ +{ + "file_version": 2, + "max_length": 2048, + "ikmax": 3000, + "genamt": 180, + "ikgen": 200, + "rep_pen": 1.01, + "rep_pen_slope": 0.9, + "rep_pen_range": 1024, + "temp": 1.0, + "top_p": 0.9, + "top_k": 40, + "top_a": 0.0, + "tfs": 0.9, + "typical": 1.0, + "numseqs": 1, + "fp32_model": false, + "modeldim": 4096, + "sampler_order": [ + 6, + 0, + 1, + 2, + 3, + 4, + 5 + + ], + "newlinemode": "n", + "lazy_load": true, + "revision": null, + "selected_preset": "", + "horde_wait_time": 0, + "horde_queue_position": 0, + "horde_queue_size": 0, + "model": "pygmalion-6b", + "model_type": "gptj", + "url": "https://api.inferkit.com/v1/models/standard/generate", + "oaiurl": "", + "oaiengines": "https://api.openai.com/v1/engines", + "colaburl": "/request", + "apikey": "", + "oaiapikey": "", + "configname": "pygmalion-6b", + "online_model": "", + "alt_multi_gen": false +} \ No newline at end of file diff --git a/public/index.html b/public/index.html index 15312d682..be05814fe 100644 --- a/public/index.html +++ b/public/index.html @@ -65,7 +65,7 @@ var online_status = 'no_connection'; var api_server = ""; - var interval_timer = setInterval(getStatus, 2000); + //var interval_timer = setInterval(getStatus, 2000); var interval_timer_novel = setInterval(getStatusNovel, 3000); var is_get_status = false; var is_get_status_novel = false; @@ -210,6 +210,7 @@ }, cache: false, dataType: "json", + crossDomain: true, contentType: "application/json", //processData: false, success: function(data){ @@ -223,9 +224,12 @@ }else{ is_pygmalion = false; } + //console.log(online_status); resultCheckStatus(); - + if(online_status !== 'no_connection'){ + var checkStatusNow = setTimeout(getStatus, 3000);//getStatus(); + } }, error: function (jqXHR, exception) { console.log(exception); @@ -621,6 +625,7 @@ } + async function preGenerate(){ var chat2 = []; var j = 0; for(var i = chat.length-1; i >= 0; i--){ @@ -654,26 +659,29 @@ var i = 0; for (var item of chat2) {//console.log(encode("dsfs").length); + chatString = item+chatString; if(encode(JSON.stringify(storyString+chatString+anchorTop+anchorBottom+charPersonality)).length+120 < this_max_context){ //(The number of tokens in the entire promt) need fix, it must count correctly (added +120, so that the description of the character does not hide) - chatString = item+chatString; - if (is_pygmalion && i == chat2.length-1) item='\n'+item; + + //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){ for(let iii = 0; iii < mesExamplesArray.length; iii++){//mesExamplesArray - + storyString = storyString+mesExamplesArray[iii]; 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 } - storyString = storyString+mesExamplesArray[iii]; + await delay(1); //arrMes[arrMes.length] = item; @@ -698,7 +706,7 @@ i++; } - + } function runGenerate(cycleGenerationPromt = ''){ if(cycleGenerationPromt === ''){ @@ -1662,7 +1670,7 @@ saveSettings(); is_get_status = true; is_api_button_press = true; - //getStatus(); + getStatus(); } }); diff --git a/server.js b/server.js index 4430d83ca..15ba56ffd 100644 --- a/server.js +++ b/server.js @@ -139,7 +139,7 @@ app.post("/generate", jsonParser, function(request, response_generate = response response_generate.send({error: true}); } }).on('error', function (err) { - //console.log(''); + console.log(err); //console.log('something went wrong on the request', err.request.options); response_generate.send({error: true}); });