Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging

This commit is contained in:
RossAscends 2023-09-17 23:00:25 +09:00
commit ef8c347a95
7 changed files with 181 additions and 27 deletions

View File

@ -0,0 +1,25 @@
{
"temp": 1.06,
"rep_pen": 1,
"rep_pen_range": 0,
"top_p": 1,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 1,
"rep_pen_slope": 0.9,
"single_line": false,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"mirostat": 2,
"mirostat_tau": 9.61,
"mirostat_eta": 1,
"use_default_badwordsids": true
}

View File

@ -0,0 +1,25 @@
{
"temp": 1.17,
"rep_pen": 1,
"rep_pen_range": 0,
"top_p": 1,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 1,
"rep_pen_slope": 0.9,
"single_line": false,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"mirostat": 2,
"mirostat_tau": 9.91,
"mirostat_eta": 1,
"use_default_badwordsids": true
}

View File

@ -0,0 +1,25 @@
{
"temp": 1.17,
"rep_pen": 1,
"rep_pen_range": 0,
"top_p": 1,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 1,
"rep_pen_slope": 0.9,
"single_line": false,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"mirostat": 2,
"mirostat_tau": 9.62,
"mirostat_eta": 1,
"use_default_badwordsids": true
}

View File

@ -0,0 +1,24 @@
{
"temp": 1.06,
"top_p": 1,
"top_k": 0,
"typical_p": 1,
"top_a": 0,
"tfs": 1,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"rep_pen": 1,
"rep_pen_range": 0,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0,
"num_beams": 1,
"length_penalty": 1,
"min_length": 0,
"encoder_rep_pen": 1,
"do_sample": true,
"early_stopping": false,
"mirostat_mode": 2,
"mirostat_tau": 9.61,
"mirostat_eta": 1,
"rep_pen_size": 0
}

View File

@ -0,0 +1,24 @@
{
"temp": 1.17,
"top_p": 1,
"top_k": 0,
"typical_p": 1,
"top_a": 0,
"tfs": 1,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"rep_pen": 1,
"rep_pen_range": 0,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0,
"num_beams": 1,
"length_penalty": 1,
"min_length": 0,
"encoder_rep_pen": 1,
"do_sample": true,
"early_stopping": false,
"mirostat_mode": 2,
"mirostat_tau": 9.91,
"mirostat_eta": 1,
"rep_pen_size": 0
}

View File

@ -0,0 +1,24 @@
{
"temp": 1.17,
"top_p": 1,
"top_k": 0,
"typical_p": 1,
"top_a": 0,
"tfs": 1,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"rep_pen": 1,
"rep_pen_range": 0,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0,
"num_beams": 1,
"length_penalty": 1,
"min_length": 0,
"encoder_rep_pen": 1,
"do_sample": true,
"early_stopping": false,
"mirostat_mode": 2,
"mirostat_tau": 9.62,
"mirostat_eta": 1,
"rep_pen_size": 0
}

View File

@ -5145,39 +5145,46 @@ export async function getChatsFromFiles(data, isGroupChat) {
let chat_dict = {}; let chat_dict = {};
let chat_list = Object.values(data).sort((a, b) => a["file_name"].localeCompare(b["file_name"])).reverse(); let chat_list = Object.values(data).sort((a, b) => a["file_name"].localeCompare(b["file_name"])).reverse();
for (const { file_name } of chat_list) { let chat_promise = chat_list.map(({ file_name}) => {
try { return new Promise(async (res, rej) => {
const endpoint = isGroupChat ? '/getgroupchat' : '/getchat'; try {
const requestBody = isGroupChat const endpoint = isGroupChat ? '/getgroupchat' : '/getchat';
? JSON.stringify({ id: file_name }) const requestBody = isGroupChat
: JSON.stringify({ ? JSON.stringify({ id: file_name })
ch_name: characters[context.characterId].name, : JSON.stringify({
file_name: file_name.replace('.jsonl', ''), ch_name: characters[context.characterId].name,
avatar_url: characters[context.characterId].avatar file_name: file_name.replace('.jsonl', ''),
avatar_url: characters[context.characterId].avatar
});
const chatResponse = await fetch(endpoint, {
method: 'POST',
headers: getRequestHeaders(),
body: requestBody,
cache: 'no-cache',
}); });
const chatResponse = await fetch(endpoint, { if (!chatResponse.ok) {
method: 'POST', return res();
headers: getRequestHeaders(), // continue;
body: requestBody, }
cache: 'no-cache',
});
if (!chatResponse.ok) { const currentChat = await chatResponse.json();
continue; if (!isGroupChat) {
// remove the first message, which is metadata, only for individual chats
currentChat.shift();
}
chat_dict[file_name] = currentChat;
} catch (error) {
console.error(error);
} }
const currentChat = await chatResponse.json(); return res();
if (!isGroupChat) { })
// remove the first message, which is metadata, only for individual chats })
currentChat.shift();
}
chat_dict[file_name] = currentChat;
} catch (error) { await Promise.all(chat_promise)
console.error(error);
}
}
return chat_dict; return chat_dict;
} }