mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
for merge
This commit is contained in:
47
public/KoboldAI Settings/Calibrated-Pygmalion-6b.settings
Normal file
47
public/KoboldAI Settings/Calibrated-Pygmalion-6b.settings
Normal file
@@ -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
|
||||||
|
}
|
@@ -65,7 +65,7 @@
|
|||||||
var online_status = 'no_connection';
|
var online_status = 'no_connection';
|
||||||
|
|
||||||
var api_server = "";
|
var api_server = "";
|
||||||
var interval_timer = setInterval(getStatus, 2000);
|
//var interval_timer = setInterval(getStatus, 2000);
|
||||||
var interval_timer_novel = setInterval(getStatusNovel, 3000);
|
var interval_timer_novel = setInterval(getStatusNovel, 3000);
|
||||||
var is_get_status = false;
|
var is_get_status = false;
|
||||||
var is_get_status_novel = false;
|
var is_get_status_novel = false;
|
||||||
@@ -210,6 +210,7 @@
|
|||||||
},
|
},
|
||||||
cache: false,
|
cache: false,
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
crossDomain: true,
|
||||||
contentType: "application/json",
|
contentType: "application/json",
|
||||||
//processData: false,
|
//processData: false,
|
||||||
success: function(data){
|
success: function(data){
|
||||||
@@ -223,9 +224,12 @@
|
|||||||
}else{
|
}else{
|
||||||
is_pygmalion = false;
|
is_pygmalion = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//console.log(online_status);
|
//console.log(online_status);
|
||||||
resultCheckStatus();
|
resultCheckStatus();
|
||||||
|
if(online_status !== 'no_connection'){
|
||||||
|
var checkStatusNow = setTimeout(getStatus, 3000);//getStatus();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
error: function (jqXHR, exception) {
|
error: function (jqXHR, exception) {
|
||||||
console.log(exception);
|
console.log(exception);
|
||||||
@@ -621,6 +625,7 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function preGenerate(){
|
||||||
var chat2 = [];
|
var chat2 = [];
|
||||||
var j = 0;
|
var j = 0;
|
||||||
for(var i = chat.length-1; i >= 0; i--){
|
for(var i = chat.length-1; i >= 0; i--){
|
||||||
@@ -654,26 +659,29 @@
|
|||||||
var i = 0;
|
var i = 0;
|
||||||
|
|
||||||
for (var item of chat2) {//console.log(encode("dsfs").length);
|
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)
|
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='<START>\n'+item;
|
//if (is_pygmalion && i == chat2.length-1) item='<START>\n'+item;
|
||||||
arrMes[arrMes.length] = item;
|
arrMes[arrMes.length] = item;
|
||||||
}else{
|
}else{
|
||||||
|
arrMes[arrMes.length-1] = '<START>\n'+arrMes[arrMes.length-1];
|
||||||
i = chat.length-1;
|
i = chat.length-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
await delay(1); //For disable slow down (encode gpt-2 need fix)
|
await delay(1); //For disable slow down (encode gpt-2 need fix)
|
||||||
//console.log(i+' '+chat.length);
|
//console.log(i+' '+chat.length);
|
||||||
|
|
||||||
if(i == chat.length-1){
|
if(i == chat.length-1){
|
||||||
|
|
||||||
for(let iii = 0; iii < mesExamplesArray.length; iii++){//mesExamplesArray
|
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(encode(JSON.stringify(storyString+chatString+anchorTop+anchorBottom+charPersonality)).length+120 < this_max_context){ //example of dialogs
|
||||||
if(!is_pygmalion){
|
if(!is_pygmalion){
|
||||||
mesExamplesArray[iii] = mesExamplesArray[iii].replace(/<START>/i, 'This is how '+name2+' should talk');//An example of how '+name2+' responds
|
mesExamplesArray[iii] = mesExamplesArray[iii].replace(/<START>/i, 'This is how '+name2+' should talk');//An example of how '+name2+' responds
|
||||||
}
|
}
|
||||||
storyString = storyString+mesExamplesArray[iii];
|
|
||||||
await delay(1);
|
await delay(1);
|
||||||
|
|
||||||
//arrMes[arrMes.length] = item;
|
//arrMes[arrMes.length] = item;
|
||||||
@@ -698,7 +706,7 @@
|
|||||||
i++;
|
i++;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
function runGenerate(cycleGenerationPromt = ''){
|
function runGenerate(cycleGenerationPromt = ''){
|
||||||
|
|
||||||
if(cycleGenerationPromt === ''){
|
if(cycleGenerationPromt === ''){
|
||||||
@@ -1662,7 +1670,7 @@
|
|||||||
saveSettings();
|
saveSettings();
|
||||||
is_get_status = true;
|
is_get_status = true;
|
||||||
is_api_button_press = true;
|
is_api_button_press = true;
|
||||||
//getStatus();
|
getStatus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -139,7 +139,7 @@ app.post("/generate", jsonParser, function(request, response_generate = response
|
|||||||
response_generate.send({error: true});
|
response_generate.send({error: true});
|
||||||
}
|
}
|
||||||
}).on('error', function (err) {
|
}).on('error', function (err) {
|
||||||
//console.log('');
|
console.log(err);
|
||||||
//console.log('something went wrong on the request', err.request.options);
|
//console.log('something went wrong on the request', err.request.options);
|
||||||
response_generate.send({error: true});
|
response_generate.send({error: true});
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user