parent
1878602647
commit
182756fcb2
|
@ -319,6 +319,10 @@
|
||||||
"filename": "presets/novel/Writers-Daemon-Kayra.json",
|
"filename": "presets/novel/Writers-Daemon-Kayra.json",
|
||||||
"type": "novel_preset"
|
"type": "novel_preset"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"filename": "presets/novel/Universal-Erato.json",
|
||||||
|
"type": "novel_preset"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"filename": "presets/textgen/Asterism.json",
|
"filename": "presets/textgen/Asterism.json",
|
||||||
"type": "textgen_preset"
|
"type": "textgen_preset"
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
{
|
||||||
|
"temperature": 1.25,
|
||||||
|
"repetition_penalty": 1.00,
|
||||||
|
"repetition_penalty_range": 0,
|
||||||
|
"repetition_penalty_slope": 0,
|
||||||
|
"repetition_penalty_frequency": 0,
|
||||||
|
"repetition_penalty_presence": 0,
|
||||||
|
"tail_free_sampling": 1,
|
||||||
|
"top_k": 0,
|
||||||
|
"top_p": 1,
|
||||||
|
"top_a": 0,
|
||||||
|
"typical_p": 1,
|
||||||
|
"min_p": 0.1,
|
||||||
|
"math1_temp": 1,
|
||||||
|
"math1_quad": 0,
|
||||||
|
"math1_quad_entropy_scale": 0,
|
||||||
|
"min_length": 1,
|
||||||
|
"prefix": "vanilla",
|
||||||
|
"cfg_uc": "",
|
||||||
|
"banned_tokens": "",
|
||||||
|
"order": [
|
||||||
|
0,
|
||||||
|
10
|
||||||
|
],
|
||||||
|
"phrase_rep_pen": "off",
|
||||||
|
"cfg_scale": 1,
|
||||||
|
"mirostat_lr": 0,
|
||||||
|
"mirostat_tau": 0
|
||||||
|
}
|
|
@ -2100,6 +2100,7 @@
|
||||||
<select id="model_novel_select">
|
<select id="model_novel_select">
|
||||||
<option value="clio-v1">Clio</option>
|
<option value="clio-v1">Clio</option>
|
||||||
<option value="kayra-v1">Kayra</option>
|
<option value="kayra-v1">Kayra</option>
|
||||||
|
<option value="llama-3-erato-v1">Erato</option>
|
||||||
</select>
|
</select>
|
||||||
<div class="flex-container">
|
<div class="flex-container">
|
||||||
<div id="api_button_novel" class="api_button menu_button menu_button_icon" type="submit" data-i18n="Connect">Connect</div>
|
<div id="api_button_novel" class="api_button menu_button menu_button_icon" type="submit" data-i18n="Connect">Connect</div>
|
||||||
|
|
|
@ -4860,6 +4860,13 @@ export function getMaxContextSize(overrideResponseLength = null) {
|
||||||
console.log(`NovelAI subscription limit reached. Max context size is now ${this_max_context}`);
|
console.log(`NovelAI subscription limit reached. Max context size is now ${this_max_context}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (nai_settings.model_novel.includes('erato')) {
|
||||||
|
// subscriber limits coming soon
|
||||||
|
this_max_context = Math.min(max_context, 8192);
|
||||||
|
|
||||||
|
// Added special tokens and whatnot
|
||||||
|
this_max_context -= 1;
|
||||||
|
}
|
||||||
|
|
||||||
this_max_context = this_max_context - (overrideResponseLength || amount_gen);
|
this_max_context = this_max_context - (overrideResponseLength || amount_gen);
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@ const maximum_output_length = 150;
|
||||||
const default_presets = {
|
const default_presets = {
|
||||||
'clio-v1': 'Talker-Chat-Clio',
|
'clio-v1': 'Talker-Chat-Clio',
|
||||||
'kayra-v1': 'Carefree-Kayra',
|
'kayra-v1': 'Carefree-Kayra',
|
||||||
|
'llama-3-erato-v1': 'Universal-Erato',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const nai_settings = {
|
export const nai_settings = {
|
||||||
|
@ -495,7 +496,14 @@ export function getNovelGenerationData(finalPrompt, settings, maxLength, isImper
|
||||||
console.log(finalPrompt);
|
console.log(finalPrompt);
|
||||||
}
|
}
|
||||||
|
|
||||||
const adjustedMaxLength = nai_settings.model_novel.includes('kayra') ? getKayraMaxResponseTokens() : maximum_output_length;
|
const isKayra = nai_settings.model_novel.includes('kayra');
|
||||||
|
const isErato = nai_settings.model_novel.includes('erato');
|
||||||
|
|
||||||
|
if (isErato) {
|
||||||
|
finalPrompt = '<|startoftext|>' + finalPrompt;
|
||||||
|
}
|
||||||
|
|
||||||
|
const adjustedMaxLength = (isKayra || isErato) ? getKayraMaxResponseTokens() : maximum_output_length;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'input': finalPrompt,
|
'input': finalPrompt,
|
||||||
|
@ -540,7 +548,8 @@ function selectPrefix(selected_prefix, finalPrompt) {
|
||||||
let useInstruct = false;
|
let useInstruct = false;
|
||||||
const clio = nai_settings.model_novel.includes('clio');
|
const clio = nai_settings.model_novel.includes('clio');
|
||||||
const kayra = nai_settings.model_novel.includes('kayra');
|
const kayra = nai_settings.model_novel.includes('kayra');
|
||||||
const isNewModel = clio || kayra;
|
const erato = nai_settings.model_novel.includes('erato');
|
||||||
|
const isNewModel = clio || kayra || erato;
|
||||||
|
|
||||||
if (isNewModel) {
|
if (isNewModel) {
|
||||||
// NovelAI claims they scan backwards 1000 characters (not tokens!) to look for instruct brackets. That's really short.
|
// NovelAI claims they scan backwards 1000 characters (not tokens!) to look for instruct brackets. That's really short.
|
||||||
|
@ -559,6 +568,9 @@ function getTokenizerTypeForModel(model) {
|
||||||
if (model.includes('kayra')) {
|
if (model.includes('kayra')) {
|
||||||
return tokenizers.NERD2;
|
return tokenizers.NERD2;
|
||||||
}
|
}
|
||||||
|
if (model.includes('erato')) {
|
||||||
|
return tokenizers.LLAMA3;
|
||||||
|
}
|
||||||
return tokenizers.NONE;
|
return tokenizers.NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -274,6 +274,9 @@ export function getTokenizerBestMatch(forApi) {
|
||||||
if (nai_settings.model_novel.includes('kayra')) {
|
if (nai_settings.model_novel.includes('kayra')) {
|
||||||
return tokenizers.NERD2;
|
return tokenizers.NERD2;
|
||||||
}
|
}
|
||||||
|
if (nai_settings.model_novel.includes('erato')) {
|
||||||
|
return tokenizers.LLAMA3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (forApi === 'kobold' || forApi === 'textgenerationwebui' || forApi === 'koboldhorde') {
|
if (forApi === 'kobold' || forApi === 'textgenerationwebui' || forApi === 'koboldhorde') {
|
||||||
// Try to use the API tokenizer if possible:
|
// Try to use the API tokenizer if possible:
|
||||||
|
|
|
@ -196,7 +196,7 @@ router.post('/generate', jsonParser, async function (req, res) {
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const baseURL = req.body.model.includes('kayra') ? TEXT_NOVELAI : API_NOVELAI;
|
const baseURL = (req.body.model.includes('kayra') || req.body.model.includes('erato')) ? TEXT_NOVELAI : API_NOVELAI;
|
||||||
const url = req.body.streaming ? `${baseURL}/ai/generate-stream` : `${baseURL}/ai/generate`;
|
const url = req.body.streaming ? `${baseURL}/ai/generate-stream` : `${baseURL}/ai/generate`;
|
||||||
const response = await fetch(url, { method: 'POST', timeout: 0, ...args });
|
const response = await fetch(url, { method: 'POST', timeout: 0, ...args });
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue