mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-02 02:47:52 +01:00
Merge branch 'staging' into webpack
This commit is contained in:
commit
1c50180daa
@ -56,6 +56,7 @@
|
|||||||
user-select: none;
|
user-select: none;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logprobs_empty_state {
|
.logprobs_empty_state {
|
||||||
|
@ -482,3 +482,7 @@ label[for="trim_spaces"]:has(input:checked) i.warning {
|
|||||||
gap: 5px;
|
gap: 5px;
|
||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#mistralai_other_models:empty {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
@ -3012,17 +3012,23 @@
|
|||||||
<option value="open-mixtral-8x7b">open-mixtral-8x7b</option>
|
<option value="open-mixtral-8x7b">open-mixtral-8x7b</option>
|
||||||
<option value="open-mixtral-8x22b">open-mixtral-8x22b</option>
|
<option value="open-mixtral-8x22b">open-mixtral-8x22b</option>
|
||||||
<option value="open-codestral-mamba">open-codestral-mamba</option>
|
<option value="open-codestral-mamba">open-codestral-mamba</option>
|
||||||
|
<option value="ministral-3b-latest">ministral-3b-latest</option>
|
||||||
|
<option value="ministral-8b-latest">ministral-8b-latest</option>
|
||||||
|
<option value="mistral-tiny-latest">mistral-tiny-latest</option>
|
||||||
<option value="mistral-small-latest">mistral-small-latest</option>
|
<option value="mistral-small-latest">mistral-small-latest</option>
|
||||||
<option value="mistral-medium-latest">mistral-medium-latest</option>
|
<option value="mistral-medium-latest">mistral-medium-latest</option>
|
||||||
<option value="mistral-large-latest">mistral-large-latest</option>
|
<option value="mistral-large-latest">mistral-large-latest</option>
|
||||||
<option value="codestral-latest">codestral-latest</option>
|
<option value="codestral-latest">codestral-latest</option>
|
||||||
<option value="codestral-mamba-latest">codestral-mamba-latest</option>
|
<option value="codestral-mamba-latest">codestral-mamba-latest</option>
|
||||||
<option value="pixtral-latest">pixtral-latest</option>
|
<option value="pixtral-12b-latest">pixtral-12b-latest</option>
|
||||||
</optgroup>
|
</optgroup>
|
||||||
<optgroup label="Sub-versions">
|
<optgroup label="Sub-versions">
|
||||||
<option value="open-mistral-nemo-2407">open-mistral-nemo-2407</option>
|
<option value="open-mistral-nemo-2407">open-mistral-nemo-2407</option>
|
||||||
<option value="open-mixtral-8x22b-2404">open-mixtral-8x22b-2404</option>
|
<option value="open-mixtral-8x22b-2404">open-mixtral-8x22b-2404</option>
|
||||||
|
<option value="ministral-3b-2410">ministral-3b-2410</option>
|
||||||
|
<option value="ministral-8b-2410">ministral-8b-2410</option>
|
||||||
<option value="mistral-tiny-2312">mistral-tiny-2312</option>
|
<option value="mistral-tiny-2312">mistral-tiny-2312</option>
|
||||||
|
<option value="mistral-tiny-2407">mistral-tiny-2407</option>
|
||||||
<option value="mistral-small-2312">mistral-small-2312</option>
|
<option value="mistral-small-2312">mistral-small-2312</option>
|
||||||
<option value="mistral-small-2402">mistral-small-2402</option>
|
<option value="mistral-small-2402">mistral-small-2402</option>
|
||||||
<option value="mistral-small-2409">mistral-small-2409</option>
|
<option value="mistral-small-2409">mistral-small-2409</option>
|
||||||
@ -3030,9 +3036,11 @@
|
|||||||
<option value="mistral-large-2402">mistral-large-2402</option>
|
<option value="mistral-large-2402">mistral-large-2402</option>
|
||||||
<option value="mistral-large-2407">mistral-large-2407</option>
|
<option value="mistral-large-2407">mistral-large-2407</option>
|
||||||
<option value="codestral-2405">codestral-2405</option>
|
<option value="codestral-2405">codestral-2405</option>
|
||||||
|
<option value="codestral-2405-blue">codestral-2405-blue</option>
|
||||||
<option value="codestral-mamba-2407">codestral-mamba-2407</option>
|
<option value="codestral-mamba-2407">codestral-mamba-2407</option>
|
||||||
<option value="pixtral-12b-2409">pixtral-12b-2409</option>
|
<option value="pixtral-12b-2409">pixtral-12b-2409</option>
|
||||||
</optgroup>
|
</optgroup>
|
||||||
|
<optgroup id="mistralai_other_models" label="Other"></optgroup>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
<head>
|
<head>
|
||||||
<base href="/">
|
<base href="/">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport"
|
<meta name="viewport" content="width=device-width, viewport-fit=cover, initial-scale=1, maximum-scale=1.0, user-scalable=no, interactive-widget=resizes-content">
|
||||||
content="width=device-width, viewport-fit=cover, initial-scale=1, maximum-scale=1.0, user-scalable=no">
|
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
<meta name="darkreader-lock">
|
<meta name="darkreader-lock">
|
||||||
<meta name="robots" content="noindex, nofollow" />
|
<meta name="robots" content="noindex, nofollow" />
|
||||||
<style>
|
<style>
|
||||||
@ -31,8 +31,6 @@
|
|||||||
<link href="css/fontawesome.min.css" rel="stylesheet">
|
<link href="css/fontawesome.min.css" rel="stylesheet">
|
||||||
<link href="css/solid.min.css" rel="stylesheet">
|
<link href="css/solid.min.css" rel="stylesheet">
|
||||||
<link href="css/user.css" rel="stylesheet">
|
<link href="css/user.css" rel="stylesheet">
|
||||||
<script src="lib/jquery-3.5.1.min.js"></script>
|
|
||||||
<script src="scripts/login.js"></script>
|
|
||||||
<title>SillyTavern</title>
|
<title>SillyTavern</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@ -65,8 +63,7 @@
|
|||||||
<div id="loginButton" class="menu_button">Login</div>
|
<div id="loginButton" class="menu_button">Login</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="passwordRecoveryBlock" style="display:none;"
|
<div id="passwordRecoveryBlock" style="display:none;" class="flex-container flexFlowColumn alignItemsCenter">
|
||||||
class="flex-container flexFlowColumn alignItemsCenter">
|
|
||||||
<div id="recoverMessage">
|
<div id="recoverMessage">
|
||||||
Recovery code has been posted to the server console.
|
Recovery code has been posted to the server console.
|
||||||
</div>
|
</div>
|
||||||
@ -84,6 +81,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="lib/jquery-3.5.1.min.js"></script>
|
||||||
|
<script src="scripts/login.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
@ -3201,7 +3201,8 @@ class StreamingProcessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onStopStreaming() {
|
onStopStreaming() {
|
||||||
this.onErrorStreaming();
|
this.abortController.abort();
|
||||||
|
this.isFinished = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3246,9 +3247,12 @@ class StreamingProcessor {
|
|||||||
console.warn(`Stream stats: ${timestamps.length} tokens, ${seconds.toFixed(2)} seconds, rate: ${Number(timestamps.length / seconds).toFixed(2)} TPS`);
|
console.warn(`Stream stats: ${timestamps.length} tokens, ${seconds.toFixed(2)} seconds, rate: ${Number(timestamps.length / seconds).toFixed(2)} TPS`);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
// in the case of a self-inflicted abort, we have already cleaned up
|
||||||
|
if (!this.isFinished) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
this.onErrorStreaming();
|
this.onErrorStreaming();
|
||||||
return;
|
}
|
||||||
|
return this.result;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.isFinished = true;
|
this.isFinished = true;
|
||||||
@ -4648,7 +4652,6 @@ export function stopGeneration() {
|
|||||||
let stopped = false;
|
let stopped = false;
|
||||||
if (streamingProcessor) {
|
if (streamingProcessor) {
|
||||||
streamingProcessor.onStopStreaming();
|
streamingProcessor.onStopStreaming();
|
||||||
streamingProcessor = null;
|
|
||||||
stopped = true;
|
stopped = true;
|
||||||
}
|
}
|
||||||
if (abortController) {
|
if (abortController) {
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
<div class="flex1 flex-container flexFlowColumn flexNoGap">
|
<div class="flex1 flex-container flexFlowColumn flexNoGap">
|
||||||
<label for="caption_multimodal_model" data-i18n="Model">Model</label>
|
<label for="caption_multimodal_model" data-i18n="Model">Model</label>
|
||||||
<select id="caption_multimodal_model" class="flex1 text_pole">
|
<select id="caption_multimodal_model" class="flex1 text_pole">
|
||||||
<option data-type="mistral" value="pixtral-latest">pixtral-latest</option>
|
<option data-type="mistral" value="pixtral-12b-latest">pixtral-12b-latest</option>
|
||||||
<option data-type="mistral" value="pixtral-12b-2409">pixtral-12b-2409</option>
|
<option data-type="mistral" value="pixtral-12b-2409">pixtral-12b-2409</option>
|
||||||
<option data-type="zerooneai" value="yi-vision">yi-vision</option>
|
<option data-type="zerooneai" value="yi-vision">yi-vision</option>
|
||||||
<option data-type="openai" value="gpt-4-vision-preview">gpt-4-vision-preview</option>
|
<option data-type="openai" value="gpt-4-vision-preview">gpt-4-vision-preview</option>
|
||||||
|
@ -89,7 +89,7 @@ function drawChunks(chunks, ids) {
|
|||||||
$('#tokenized_chunks_display').empty();
|
$('#tokenized_chunks_display').empty();
|
||||||
|
|
||||||
for (let i = 0; i < chunks.length; i++) {
|
for (let i = 0; i < chunks.length; i++) {
|
||||||
let chunk = chunks[i].replace(/▁/g, ' '); // This is a leading space in sentencepiece. More info: Lower one eighth block (U+2581)
|
let chunk = chunks[i].replace(/[▁Ġ]/g, ' '); // This is a leading space in sentencepiece. More info: Lower one eighth block (U+2581)
|
||||||
|
|
||||||
// If <0xHEX>, decode it
|
// If <0xHEX>, decode it
|
||||||
if (/^<0x[0-9A-F]+>$/i.test(chunk)) {
|
if (/^<0x[0-9A-F]+>$/i.test(chunk)) {
|
||||||
|
@ -160,7 +160,7 @@ function renderTopLogprobs() {
|
|||||||
let matched = false;
|
let matched = false;
|
||||||
for (const [token, probability, log] of candidates) {
|
for (const [token, probability, log] of candidates) {
|
||||||
const container = $('<button class="flex-container flexFlowColumn logprobs_top_candidate"></button>');
|
const container = $('<button class="flex-container flexFlowColumn logprobs_top_candidate"></button>');
|
||||||
const tokenNormalized = String(token).replace(/^▁/g, ' ');
|
const tokenNormalized = String(token).replace(/^[▁Ġ]/g, ' ');
|
||||||
|
|
||||||
if (token === selectedToken || tokenNormalized === selectedToken) {
|
if (token === selectedToken || tokenNormalized === selectedToken) {
|
||||||
matched = true;
|
matched = true;
|
||||||
@ -230,7 +230,7 @@ function onAlternativeClicked(tokenLogprobs, alternative) {
|
|||||||
const replaceIndex = messageLogprobs.findIndex(x => x === tokenLogprobs);
|
const replaceIndex = messageLogprobs.findIndex(x => x === tokenLogprobs);
|
||||||
|
|
||||||
const tokens = messageLogprobs.slice(0, replaceIndex + 1).map(({ token }) => token);
|
const tokens = messageLogprobs.slice(0, replaceIndex + 1).map(({ token }) => token);
|
||||||
tokens[replaceIndex] = String(alternative).replace(/^▁/g, ' ');
|
tokens[replaceIndex] = String(alternative).replace(/^[▁Ġ]/g, ' ').replace(/Ċ/g, '\n');
|
||||||
|
|
||||||
const prefix = continueFrom || '';
|
const prefix = continueFrom || '';
|
||||||
const prompt = prefix + tokens.join('');
|
const prompt = prefix + tokens.join('');
|
||||||
@ -343,7 +343,7 @@ function createSwipe(messageId, prompt) {
|
|||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
function toVisibleWhitespace(input) {
|
function toVisibleWhitespace(input) {
|
||||||
return input.replace(/ /g, '·').replace(/▁/g, '·').replace(/\n/g, '↵');
|
return input.replace(/ /g, '·').replace(/[▁Ġ]/g, '·').replace(/[Ċ\n]/g, '↵');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -362,7 +362,7 @@ function withVirtualWhitespace(text, span) {
|
|||||||
if (text.match(/\s$/)) {
|
if (text.match(/\s$/)) {
|
||||||
result.push($(document.createTextNode('\u200b')));
|
result.push($(document.createTextNode('\u200b')));
|
||||||
}
|
}
|
||||||
if (text.match(/^▁/)) {
|
if (text.match(/^[▁Ġ]/)) {
|
||||||
result.unshift(document.createTextNode('\u200b'));
|
result.unshift(document.createTextNode('\u200b'));
|
||||||
}
|
}
|
||||||
// line breaks are trickier. we don't currently handle consecutive line
|
// line breaks are trickier. we don't currently handle consecutive line
|
||||||
|
@ -1610,6 +1610,33 @@ function saveModelList(data) {
|
|||||||
|
|
||||||
$('#model_blockentropy_select').val(oai_settings.blockentropy_model).trigger('change');
|
$('#model_blockentropy_select').val(oai_settings.blockentropy_model).trigger('change');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (oai_settings.chat_completion_source == chat_completion_sources.MISTRALAI) {
|
||||||
|
/** @type {HTMLSelectElement} */
|
||||||
|
const mistralModelSelect = document.querySelector('#model_mistralai_select');
|
||||||
|
if (mistralModelSelect) {
|
||||||
|
const options = Array.from(mistralModelSelect.options);
|
||||||
|
options.forEach((option) => {
|
||||||
|
const existingModel = model_list.find(model => model.id === option.value);
|
||||||
|
if (!existingModel) {
|
||||||
|
option.remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const otherOptionsGroup = mistralModelSelect.querySelector('#mistralai_other_models');
|
||||||
|
for (const model of model_list.filter(model => model?.capabilities?.completion_chat)) {
|
||||||
|
if (!options.some(option => option.value === model.id) && otherOptionsGroup) {
|
||||||
|
otherOptionsGroup.append(new Option(model.id, model.id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const selectedModel = model_list.find(model => model.id === oai_settings.mistralai_model);
|
||||||
|
if (!selectedModel) {
|
||||||
|
oai_settings.mistralai_model = model_list.find(model => model?.capabilities?.completion_chat)?.id;
|
||||||
|
$('#model_mistralai_select').val(oai_settings.mistralai_model).trigger('change');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function appendOpenRouterOptions(model_list, groupModels = false, sort = false) {
|
function appendOpenRouterOptions(model_list, groupModels = false, sort = false) {
|
||||||
@ -4103,6 +4130,8 @@ async function onModelChange() {
|
|||||||
$('#openai_max_context').attr('max', max_64k);
|
$('#openai_max_context').attr('max', max_64k);
|
||||||
} else if (oai_settings.mistralai_model.includes('pixtral')) {
|
} else if (oai_settings.mistralai_model.includes('pixtral')) {
|
||||||
$('#openai_max_context').attr('max', max_128k);
|
$('#openai_max_context').attr('max', max_128k);
|
||||||
|
} else if (oai_settings.mistralai_model.includes('ministral')) {
|
||||||
|
$('#openai_max_context').attr('max', max_32k);
|
||||||
} else {
|
} else {
|
||||||
$('#openai_max_context').attr('max', max_32k);
|
$('#openai_max_context').attr('max', max_32k);
|
||||||
}
|
}
|
||||||
@ -4660,6 +4689,8 @@ export function isImageInliningSupported() {
|
|||||||
'chatgpt-4o-latest',
|
'chatgpt-4o-latest',
|
||||||
'yi-vision',
|
'yi-vision',
|
||||||
'pixtral-latest',
|
'pixtral-latest',
|
||||||
|
'pixtral-12b-latest',
|
||||||
|
'pixtral-12b',
|
||||||
'pixtral-12b-2409',
|
'pixtral-12b-2409',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user