mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge branch 'staging' into wi-duplicate
This commit is contained in:
6
package-lock.json
generated
6
package-lock.json
generated
@@ -2413,9 +2413,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/follow-redirects": {
|
"node_modules/follow-redirects": {
|
||||||
"version": "1.15.2",
|
"version": "1.15.4",
|
||||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
|
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz",
|
||||||
"integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==",
|
"integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "individual",
|
"type": "individual",
|
||||||
|
@@ -42,6 +42,9 @@
|
|||||||
},
|
},
|
||||||
"vectra": {
|
"vectra": {
|
||||||
"openai": "^4.17.0"
|
"openai": "^4.17.0"
|
||||||
|
},
|
||||||
|
"axios": {
|
||||||
|
"follow-redirects": "^1.15.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"name": "sillytavern",
|
"name": "sillytavern",
|
||||||
|
@@ -1161,8 +1161,8 @@
|
|||||||
<span data-i18n="temperature">Temperature</span>
|
<span data-i18n="temperature">Temperature</span>
|
||||||
<div class="fa-solid fa-circle-info opacity50p" title="Temperature controls the randomness in token selection: - low temperature (<1.0) leads to more predictable text, favoring higher probability tokens. - high temperature (>1.0) increases creativity and diversity in the output by giving lower probability tokens a better chance. Set to 1.0 for the original probabilities."></div>
|
<div class="fa-solid fa-circle-info opacity50p" title="Temperature controls the randomness in token selection: - low temperature (<1.0) leads to more predictable text, favoring higher probability tokens. - high temperature (>1.0) increases creativity and diversity in the output by giving lower probability tokens a better chance. Set to 1.0 for the original probabilities."></div>
|
||||||
</small>
|
</small>
|
||||||
<input class="neo-range-slider" type="range" id="temp_textgenerationwebui" name="volume" min="0.0" max="4.0" step="0.01" x-setting-id="temp">
|
<input class="neo-range-slider" type="range" id="temp_textgenerationwebui" name="volume" min="0.0" max="5.0" step="0.01" x-setting-id="temp">
|
||||||
<input class="neo-range-input" type="number" min="0.0" max="4.0" step="0.01" data-for="temp_textgenerationwebui" id="temp_counter_textgenerationwebui">
|
<input class="neo-range-input" type="number" min="0.0" max="5.0" step="0.01" data-for="temp_textgenerationwebui" id="temp_counter_textgenerationwebui">
|
||||||
</div>
|
</div>
|
||||||
<div data-newbie-hidden class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0">
|
<div data-newbie-hidden class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0">
|
||||||
<small>
|
<small>
|
||||||
@@ -1270,6 +1270,30 @@
|
|||||||
<input class="neo-range-input" type="number" min="0" max="5" step="1" data-for="prompt_log_probs_aphrodite" id="prompt_log_probs_aphrodite_counter_textgenerationwebui">
|
<input class="neo-range-input" type="number" min="0" max="5" step="1" data-for="prompt_log_probs_aphrodite" id="prompt_log_probs_aphrodite_counter_textgenerationwebui">
|
||||||
</div>
|
</div>
|
||||||
-->
|
-->
|
||||||
|
<div data-newbie-hidden name="dynaTempBlock" class="wide100p">
|
||||||
|
<h4 class="wide100p textAlignCenter" data-i18n="DynaTemp">
|
||||||
|
<div class="flex-container alignitemscenter" style="justify-content: center;">
|
||||||
|
<div class="checkbox_label" for="dynatemp_textgenerationwebui">
|
||||||
|
<input type="checkbox" id="dynatemp_textgenerationwebui" />
|
||||||
|
<small data-i18n="dynatemp"></small>
|
||||||
|
</div>
|
||||||
|
<span style="text-align: center;">Dynamic Temperature</span>
|
||||||
|
<div class="fa-solid fa-circle-info opacity50p" title="Scales Temperature dynamically per token (based on the variation of probabilities.)"></div>
|
||||||
|
</div>
|
||||||
|
</h4>
|
||||||
|
<div class="flex-container flexFlowRow alignitemscenter gap10px flexShrink">
|
||||||
|
<div class="alignitemscenter flex-container marginBot5 flexFlowColumn flexGrow flexShrink gap0">
|
||||||
|
<small data-i18n="Minimum Temp">Minimum Temp</small>
|
||||||
|
<input class="neo-range-slider" type="range" id="min_temp_textgenerationwebui" name="volume" min="0" max="5" step="0.1" />
|
||||||
|
<input class="neo-range-input" type="number" min="0" max="5" step="0.1" data-for="min_temp_textgenerationwebui" id="min_temp_counter_textgenerationwebui">
|
||||||
|
</div>
|
||||||
|
<div class="alignitemscenter flex-container marginBot5 flexFlowColumn flexGrow flexShrink gap0">
|
||||||
|
<small data-i18n="Maximum Temp">Maximum Temp</small>
|
||||||
|
<input class="neo-range-slider" type="range" id="max_temp_textgenerationwebui" name="volume" min="0" max="5" step="0.1" />
|
||||||
|
<input class="neo-range-input" type="number" min="0" max="5" step="0.1" data-for="max_temp_textgenerationwebui" id="max_temp_counter_textgenerationwebui">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div data-newbie-hidden name="miroStatBlock" class="wide100p">
|
<div data-newbie-hidden name="miroStatBlock" class="wide100p">
|
||||||
<h4 class="wide100p textAlignCenter" data-i18n="Mirostat (mode=1 is only for llama.cpp)">Mirostat
|
<h4 class="wide100p textAlignCenter" data-i18n="Mirostat (mode=1 is only for llama.cpp)">Mirostat
|
||||||
<div class=" fa-solid fa-circle-info opacity50p " title="Mode=1 is only for llama.cpp More helpful tips coming soon."></div>
|
<div class=" fa-solid fa-circle-info opacity50p " title="Mode=1 is only for llama.cpp More helpful tips coming soon."></div>
|
||||||
@@ -1315,18 +1339,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div data-newbie-hidden name="dynaTempBlock" class="wide100p">
|
|
||||||
<h4 class="wide100p textAlignCenter" data-i18n="DynaTemp">DynaTemp
|
|
||||||
<div class=" fa-solid fa-circle-info opacity50p " title="Set range to 0 to Deactivate."></div>
|
|
||||||
</h4>
|
|
||||||
<div class="flex-container flexFlowRow alignitemscenter gap10px flexShrink">
|
|
||||||
<div class="alignitemscenter flex-container marginBot5 flexFlowColumn flexGrow flexShrink gap0">
|
|
||||||
<small data-i18n="DynaTemp Range">DynaTemp Range</small>
|
|
||||||
<input class="neo-range-slider" type="range" id="dynatemp_range_textgenerationwebui" name="volume" min="0" max="2.0" step="0.1" />
|
|
||||||
<input class="neo-range-input" type="number" min="0" max="2.0" step="0.1" data-for="dynatemp_range_textgenerationwebui" id="dynatemp_range_counter_textgenerationwebui">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div data-forAphro=False data-newbie-hidden name="contrastiveSearchBlock" class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0">
|
<div data-forAphro=False data-newbie-hidden name="contrastiveSearchBlock" class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0">
|
||||||
<h4 class="textAlignCenter" data-i18n="Contrastive search">Contrast Search
|
<h4 class="textAlignCenter" data-i18n="Contrastive search">Contrast Search
|
||||||
<div class=" fa-solid fa-circle-info opacity50p " title="Helpful tip coming soon."></div>
|
<div class=" fa-solid fa-circle-info opacity50p " title="Helpful tip coming soon."></div>
|
||||||
|
@@ -3473,7 +3473,7 @@ async function Generate(type, { automatic_trigger, force_name2, quiet_prompt, qu
|
|||||||
// need a detection for what the quiet prompt is being asked for...
|
// need a detection for what the quiet prompt is being asked for...
|
||||||
|
|
||||||
// Bail out early?
|
// Bail out early?
|
||||||
if (quietToLoud !== true) {
|
if (!isInstruct && !quietToLoud) {
|
||||||
return lastMesString;
|
return lastMesString;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3481,7 +3481,7 @@ async function Generate(type, { automatic_trigger, force_name2, quiet_prompt, qu
|
|||||||
|
|
||||||
// Get instruct mode line
|
// Get instruct mode line
|
||||||
if (isInstruct && !isContinue) {
|
if (isInstruct && !isContinue) {
|
||||||
const name = isImpersonate ? name1 : name2;
|
const name = (quiet_prompt && !quietToLoud) ? 'System' : (isImpersonate ? name1 : name2);
|
||||||
lastMesString += formatInstructModePrompt(name, isImpersonate, promptBias, name1, name2);
|
lastMesString += formatInstructModePrompt(name, isImpersonate, promptBias, name1, name2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -4,7 +4,7 @@ import {
|
|||||||
characters,
|
characters,
|
||||||
getRequestHeaders,
|
getRequestHeaders,
|
||||||
} from '../../../script.js';
|
} from '../../../script.js';
|
||||||
import { selected_group } from '../../group-chats.js';
|
import { groups, selected_group } from '../../group-chats.js';
|
||||||
import { loadFileToDocument, delay } from '../../utils.js';
|
import { loadFileToDocument, delay } from '../../utils.js';
|
||||||
import { loadMovingUIState } from '../../power-user.js';
|
import { loadMovingUIState } from '../../power-user.js';
|
||||||
import { dragElement } from '../../RossAscends-mods.js';
|
import { dragElement } from '../../RossAscends-mods.js';
|
||||||
@@ -416,7 +416,26 @@ function viewWithDragbox(items) {
|
|||||||
|
|
||||||
// Registers a simple command for opening the char gallery.
|
// Registers a simple command for opening the char gallery.
|
||||||
registerSlashCommand('show-gallery', showGalleryCommand, ['sg'], '– shows the gallery', true, true);
|
registerSlashCommand('show-gallery', showGalleryCommand, ['sg'], '– shows the gallery', true, true);
|
||||||
|
registerSlashCommand('list-gallery', listGalleryCommand, ['lg'], '<span class="monospace">[optional char=charName] [optional group=groupName]</span> – list images in the gallery of the current char / group or a specified char / group', true, true);
|
||||||
|
|
||||||
function showGalleryCommand(args) {
|
function showGalleryCommand(args) {
|
||||||
showCharGallery();
|
showCharGallery();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function listGalleryCommand(args) {
|
||||||
|
try {
|
||||||
|
let url = args.char ?? (args.group ? groups.find(it=>it.name == args.group)?.id : null) ?? (selected_group || this_chid);
|
||||||
|
if (!args.char && !args.group && !selected_group && this_chid) {
|
||||||
|
const char = characters[this_chid];
|
||||||
|
url = char.avatar.replace('.png', '');
|
||||||
|
}
|
||||||
|
|
||||||
|
const items = await getGalleryItems(url);
|
||||||
|
return JSON.stringify(items.map(it=>it.src));
|
||||||
|
|
||||||
|
} catch (err) {
|
||||||
|
console.trace();
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
return JSON.stringify([]);
|
||||||
|
}
|
||||||
|
@@ -608,7 +608,8 @@ async function CreateZenSliders(elmnt) {
|
|||||||
sliderID == 'rep_pen_range') {
|
sliderID == 'rep_pen_range') {
|
||||||
decimals = 0;
|
decimals = 0;
|
||||||
}
|
}
|
||||||
if (sliderID == 'dynatemp_range_textgenerationwebui') {
|
if (sliderID == 'min_temp_textgenerationwebui' ||
|
||||||
|
sliderID == 'max_temp_textgenerationwebui') {
|
||||||
decimals = 2;
|
decimals = 2;
|
||||||
}
|
}
|
||||||
if (sliderID == 'eta_cutoff_textgenerationwebui' ||
|
if (sliderID == 'eta_cutoff_textgenerationwebui' ||
|
||||||
@@ -635,13 +636,14 @@ async function CreateZenSliders(elmnt) {
|
|||||||
sliderID == 'tfs_textgenerationwebui' ||
|
sliderID == 'tfs_textgenerationwebui' ||
|
||||||
sliderID == 'min_p_textgenerationwebui' ||
|
sliderID == 'min_p_textgenerationwebui' ||
|
||||||
sliderID == 'temp_textgenerationwebui' ||
|
sliderID == 'temp_textgenerationwebui' ||
|
||||||
sliderID == 'temp' ||
|
sliderID == 'temp') {
|
||||||
sliderID == 'dynatemp_range_textgenerationwebui') {
|
|
||||||
numSteps = 20;
|
numSteps = 20;
|
||||||
}
|
}
|
||||||
if (sliderID == 'mirostat_eta_textgenerationwebui' ||
|
if (sliderID == 'mirostat_eta_textgenerationwebui' ||
|
||||||
sliderID == 'penalty_alpha_textgenerationwebui' ||
|
sliderID == 'penalty_alpha_textgenerationwebui' ||
|
||||||
sliderID == 'length_penalty_textgenerationwebui') {
|
sliderID == 'length_penalty_textgenerationwebui' ||
|
||||||
|
sliderID == 'min_temp_textgenerationwebui' ||
|
||||||
|
sliderID == 'max_temp_textgenerationwebui') {
|
||||||
numSteps = 50;
|
numSteps = 50;
|
||||||
}
|
}
|
||||||
//customize off values
|
//customize off values
|
||||||
|
@@ -79,7 +79,9 @@ const settings = {
|
|||||||
presence_pen: 0,
|
presence_pen: 0,
|
||||||
do_sample: true,
|
do_sample: true,
|
||||||
early_stopping: false,
|
early_stopping: false,
|
||||||
dynatemp_range: 0,
|
dynatemp: false,
|
||||||
|
min_temp: 0,
|
||||||
|
max_temp: 2.0,
|
||||||
seed: -1,
|
seed: -1,
|
||||||
preset: 'Default',
|
preset: 'Default',
|
||||||
add_bos_token: true,
|
add_bos_token: true,
|
||||||
@@ -138,7 +140,9 @@ const setting_names = [
|
|||||||
'num_beams',
|
'num_beams',
|
||||||
'length_penalty',
|
'length_penalty',
|
||||||
'min_length',
|
'min_length',
|
||||||
'dynatemp_range',
|
'dynatemp',
|
||||||
|
'min_temp',
|
||||||
|
'max_temp',
|
||||||
'encoder_rep_pen',
|
'encoder_rep_pen',
|
||||||
'freq_pen',
|
'freq_pen',
|
||||||
'presence_pen',
|
'presence_pen',
|
||||||
@@ -706,7 +710,7 @@ export function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate,
|
|||||||
'model': getModel(),
|
'model': getModel(),
|
||||||
'max_new_tokens': maxTokens,
|
'max_new_tokens': maxTokens,
|
||||||
'max_tokens': maxTokens,
|
'max_tokens': maxTokens,
|
||||||
'temperature': settings.temp,
|
'temperature': settings.dynatemp ? (settings.min_temp + settings.max_temp) / 2 : settings.temp,
|
||||||
'top_p': settings.top_p,
|
'top_p': settings.top_p,
|
||||||
'typical_p': settings.typical_p,
|
'typical_p': settings.typical_p,
|
||||||
'min_p': settings.min_p,
|
'min_p': settings.min_p,
|
||||||
@@ -720,7 +724,10 @@ export function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate,
|
|||||||
'length_penalty': settings.length_penalty,
|
'length_penalty': settings.length_penalty,
|
||||||
'early_stopping': settings.early_stopping,
|
'early_stopping': settings.early_stopping,
|
||||||
'add_bos_token': settings.add_bos_token,
|
'add_bos_token': settings.add_bos_token,
|
||||||
'dynatemp_range': settings.dynatemp_range,
|
'dynamic_temperature': settings.dynatemp,
|
||||||
|
'dynatemp_low': settings.min_temp,
|
||||||
|
'dynatemp_high': settings.max_temp,
|
||||||
|
'dynatemp_range': settings.dynatemp ? (settings.max_temp - settings.min_temp) / 2 : 0,
|
||||||
'stopping_strings': getStoppingStrings(isImpersonate, isContinue),
|
'stopping_strings': getStoppingStrings(isImpersonate, isContinue),
|
||||||
'stop': getStoppingStrings(isImpersonate, isContinue),
|
'stop': getStoppingStrings(isImpersonate, isContinue),
|
||||||
'truncation_length': max_context,
|
'truncation_length': max_context,
|
||||||
|
@@ -1916,6 +1916,11 @@ async function checkWorldInfo(chat, maxContext) {
|
|||||||
needsToScan = false;
|
needsToScan = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (newEntries.length === 0) {
|
||||||
|
console.debug('No new entries activated, stopping');
|
||||||
|
needsToScan = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (needsToScan) {
|
if (needsToScan) {
|
||||||
const text = newEntries
|
const text = newEntries
|
||||||
.filter(x => !failedProbabilityChecks.has(x))
|
.filter(x => !failedProbabilityChecks.has(x))
|
||||||
@@ -2017,13 +2022,17 @@ function filterByInclusionGroups(newEntries, allActivatedEntries) {
|
|||||||
for (const [key, group] of Object.entries(grouped)) {
|
for (const [key, group] of Object.entries(grouped)) {
|
||||||
console.debug(`Checking inclusion group '${key}' with ${group.length} entries`, group);
|
console.debug(`Checking inclusion group '${key}' with ${group.length} entries`, group);
|
||||||
|
|
||||||
if (!Array.isArray(group) || group.length <= 1) {
|
if (Array.from(allActivatedEntries).some(x => x.group === key)) {
|
||||||
console.debug('Skipping inclusion group check, only one entry');
|
console.debug(`Skipping inclusion group check, group already activated '${key}'`);
|
||||||
|
// We need to forcefully deactivate all other entries in the group
|
||||||
|
for (const entry of group) {
|
||||||
|
newEntries.splice(newEntries.indexOf(entry), 1);
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Array.from(allActivatedEntries).some(x => x.group === key)) {
|
if (!Array.isArray(group) || group.length <= 1) {
|
||||||
console.debug(`Skipping inclusion group check, group already activated '${key}'`);
|
console.debug('Skipping inclusion group check, only one entry');
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user