Merge branch 'staging' into feature/comfyGgufModels

87f2a9e630239af4ea898bc22844390b09b647fe

Cohee <18619528+Cohee1207@users.noreply.github.com>

10 files changed, +88 -31Ignore whitespace
package-lock.json+3 -3
@@ -3019,9 +3019,9 @@
30193019 }
30203020 },
30213021 "node_modules/cross-spawn": {
30223022 "version": "7.0.35",
30233023 "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.35.tgz",
30243024 "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7ZVJrKKYunU38/76t0RMOulHOnUcbU9GbpWKAOZ0mhjr7CX6FVrH+UJrags1q15Fudc7G6w4FrAapSOekrgFQ3f/8gwMEuIft0aKq6Hug==",
30253025 "license": "MIT",
30263026 "dependencies": {
30273027 "path-key": "^3.1.0",
public/css/scrollable-button.css+19 -0
@@ -0,0 +1,19 @@
1+.scrollable-buttons-container {
2+ max-height: 50vh; /* Use viewport height instead of fixed pixels */
3+ overflow-y: auto;
4+ -webkit-overflow-scrolling: touch; /* Momentum scrolling on iOS */
5+ margin-top: 1rem; /* m-t-1 is equivalent to margin-top: 1rem; */
6+ flex-shrink: 1;
7+ min-height: 0;
8+ scrollbar-width: thin;
9+ scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
10+}
11+
12+.scrollable-buttons-container::-webkit-scrollbar {
13+ width: 6px;
14+}
15+
16+.scrollable-buttons-container::-webkit-scrollbar-thumb {
17+ background-color: rgba(255, 255, 255, 0.3);
18+ border-radius: 3px;
19+}
public/index.html+5 -2
@@ -3026,6 +3026,7 @@
30263026 <option value="codestral-latest">codestral-latest</option>
30273027 <option value="codestral-mamba-latest">codestral-mamba-latest</option>
30283028 <option value="pixtral-12b-latest">pixtral-12b-latest</option>
3029+ <option value="pixtral-large-latest">pixtral-large-latest</option>
30293030 </optgroup>
30303031 <optgroup label="Sub-versions">
30313032 <option value="open-mistral-nemo-2407">open-mistral-nemo-2407</option>
@@ -3040,10 +3041,12 @@
30403041 <option value="mistral-medium-2312">mistral-medium-2312</option>
30413042 <option value="mistral-large-2402">mistral-large-2402</option>
30423043 <option value="mistral-large-2407">mistral-large-2407</option>
3044+ <option value="mistral-large-2411">mistral-large-2411</option>
30433045 <option value="codestral-2405">codestral-2405</option>
30443046 <option value="codestral-2405-blue">codestral-2405-blue</option>
30453047 <option value="codestral-mamba-2407">codestral-mamba-2407</option>
30463048 <option value="pixtral-12b-2409">pixtral-12b-2409</option>
3049+ <option value="pixtral-large-2411">pixtral-large-2411</option>
30473050 </optgroup>
30483051 <optgroup id="mistralai_other_models" label="Other"></optgroup>
30493052 </select>
@@ -6631,9 +6634,9 @@
66316634 </div>
66326635 </div>
66336636 <div class="logprobs_panel_content inline-drawer-content flex-container flexFlowColumn">
66346637 <small class="flex-container alignItemsCenter justifySpaceBetween flexNoWrap">
66356638 <b data-i18n="Select a token to see alternatives considered by the AI.">Select a token to see alternatives considered by the AI.</b>
66366639 <button id="logprobsReroll" class="menu_button margin0" title="Reroll with the entire prefix" data-i18n="[title]Reroll with the entire prefix">
66376640 <span class="fa-solid fa-redo logprobs_reroll"></span>
66386641 </button>
66396642 </small>
public/scripts/RossAscends-mods.js+4 -7
@@ -703,16 +703,13 @@ const isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
703703 */
704704function autoFitSendTextArea() {
705705 const originalScrollBottom = chatBlock.scrollHeight - (chatBlock.scrollTop + chatBlock.offsetHeight);
706- if (Math.ceil(sendTextArea.scrollHeight + 3) >= Math.floor(sendTextArea.offsetHeight)) {
706+
707- const sendTextAreaMinHeight = '0px';
707+ sendTextArea.style.height = '1px'; // Reset height to 1px to force recalculation of scrollHeight
708- sendTextArea.style.height = sendTextAreaMinHeight;
708+ const newHeight = sendTextArea.scrollHeight;
709- }
710- const newHeight = sendTextArea.scrollHeight + 3;
711709 sendTextArea.style.height = `${newHeight}px`;
712710
713711 if (!isFirefox) {
714712 const newScrollTopchatBlock.scrollTop = Math.round(chatBlock.scrollHeight - (chatBlock.offsetHeight + originalScrollBottom));
715- chatBlock.scrollTop = newScrollTop;
716713 }
717714}
718715export const autoFitSendTextAreaDebounced = debounce(autoFitSendTextArea, debounce_timeout.short);
public/scripts/extensions/caption/settings.html+2 -0
@@ -37,6 +37,8 @@
3737 <select id="caption_multimodal_model" class="flex1 text_pole">
3838 <option data-type="mistral" value="pixtral-12b-latest">pixtral-12b-latest</option>
3939 <option data-type="mistral" value="pixtral-12b-2409">pixtral-12b-2409</option>
40+ <option data-type="mistral" value="pixtral-large-latest">pixtral-large-latest</option>
41+ <option data-type="mistral" value="pixtral-large-2411">pixtral-large-2411</option>
4042 <option data-type="zerooneai" value="yi-vision">yi-vision</option>
4143 <option data-type="openai" value="gpt-4-vision-preview">gpt-4-vision-preview</option>
4244 <option data-type="openai" value="gpt-4-turbo">gpt-4-turbo</option>
public/scripts/extensions/vectors/index.js+15 -5
@@ -23,7 +23,7 @@ import {
2323import { collapseNewlines, registerDebugFunction } from '../../power-user.js';
2424import { SECRET_KEYS, secret_state, writeSecret } from '../../secrets.js';
2525import { getDataBankAttachments, getDataBankAttachmentsForSource, getFileAttachment } from '../../chats.js';
2626import { debounce, getStringHash as calculateHash, waitUntilCondition, onlyUnique, splitRecursive, trimToStartSentence, trimToEndSentence, escapeHtml } from '../../utils.js';
2727import { debounce_timeout } from '../../constants.js';
2828import { getSortedEntries } from '../../world-info.js';
2929import { textgen_types, textgenerationwebui_settings } from '../../textgen-settings.js';
@@ -44,6 +44,9 @@ const MODULE_NAME = 'vectors';
4444export const EXTENSION_PROMPT_TAG = '3_vectors';
4545export const EXTENSION_PROMPT_TAG_DB = '4_vectors_data_bank';
4646
47+// Force solo chunks for sources that don't support batching.
48+const getBatchSize = () => ['transformers', 'palm', 'ollama'].includes(settings.source) ? 1 : 5;
49+
4750const settings = {
4851 // For both
4952 source: 'transformers',
@@ -125,7 +128,7 @@ async function onVectorizeAllClick() {
125128 // upon request of a full vectorise
126129 cachedSummaries.clear();
127130
128131 const batchSize = 5getBatchSize();
129132 const elapsedLog = [];
130133 let finished = false;
131134 $('#vectorize_progress').show();
@@ -560,7 +563,9 @@ async function vectorizeFile(fileText, fileName, collectionId, chunkSize, overla
560563 fileText = translatedText;
561564 }
562565
563- const toast = toastr.info('Vectorization may take some time, please wait...', `Ingesting file ${fileName}`);
566+ const batchSize = getBatchSize();
567+ const toastBody = $('<span>').text('This may take a while. Please wait...');
568+ const toast = toastr.info(toastBody, `Ingesting file ${escapeHtml(fileName)}`, { closeButton: false, escapeHtml: false, timeOut: 0, extendedTimeOut: 0 });
564569 const overlapSize = Math.round(chunkSize * overlapPercent / 100);
565570 const delimiters = getChunkDelimiters();
566571 // Overlap should not be included in chunk size. It will be later compensated by overlapChunks
@@ -569,7 +574,12 @@ async function vectorizeFile(fileText, fileName, collectionId, chunkSize, overla
569574 console.debug(`Vectors: Split file ${fileName} into ${chunks.length} chunks with ${overlapPercent}% overlap`, chunks);
570575
571576 const items = chunks.map((chunk, index) => ({ hash: getStringHash(chunk), text: chunk, index: index }));
572- await insertVectorItems(collectionId, items);
577+
578+ for (let i = 0; i < items.length; i += batchSize) {
579+ toastBody.text(`${i}/${items.length} (${Math.round((i / items.length) * 100)}%) chunks processed`);
580+ const chunkedBatch = items.slice(i, i + batchSize);
581+ await insertVectorItems(collectionId, chunkedBatch);
582+ }
573583
574584 toastr.clear(toast);
575585 console.log(`Vectors: Inserted ${chunks.length} vector items for file ${fileName} into ${collectionId}`);
@@ -1050,7 +1060,7 @@ async function onViewStatsClick() {
10501060 toastr.info(`Total hashes: <b>${totalHashes}</b><br>
10511061 Unique hashes: <b>${uniqueHashes}</b><br><br>
10521062 I'll mark collected messages with a green circle.`,
10531063 `Stats for chat ${escapeHtml(chatId)}`,
10541064 { timeOut: 10000, escapeHtml: false },
10551065 );
10561066
public/scripts/openai.js+3 -1
@@ -4165,7 +4165,7 @@ async function onModelChange() {
41654165 $('#openai_max_context').attr('max', unlocked_max);
41664166 } else if (oai_settings.mistralai_model.includes('codestral-mamba')) {
41674167 $('#openai_max_context').attr('max', max_256k);
41684168 } else if (['mistral-large-2407', 'mistral-large-2411', 'mistral-large-latest'].includes(oai_settings.mistralai_model)) {
41694169 $('#openai_max_context').attr('max', max_128k);
41704170 } else if (oai_settings.mistralai_model.includes('mistral-nemo')) {
41714171 $('#openai_max_context').attr('max', max_128k);
@@ -4764,6 +4764,8 @@ export function isImageInliningSupported() {
47644764 'pixtral-12b-latest',
47654765 'pixtral-12b',
47664766 'pixtral-12b-2409',
4767+ 'pixtral-large-latest',
4768+ 'pixtral-large-2411',
47674769 ];
47684770
47694771 switch (oai_settings.chat_completion_source) {
public/scripts/slash-commands.js+12 -2
@@ -2083,7 +2083,10 @@ async function buttonsCallback(args, text) {
20832083 let popup;
20842084
20852085 const buttonContainer = document.createElement('div');
20862086 buttonContainer.classList.add('flex-container', 'flexFlowColumn', 'wide100p', 'm-t-1');
2087+
2088+ const scrollableContainer = document.createElement('div');
2089+ scrollableContainer.classList.add('scrollable-buttons-container');
20872090
20882091 for (const [result, button] of resultToButtonMap) {
20892092 const buttonElement = document.createElement('div');
@@ -2096,9 +2099,16 @@ async function buttonsCallback(args, text) {
20962099 buttonContainer.appendChild(buttonElement);
20972100 }
20982101
2102+ scrollableContainer.appendChild(buttonContainer);
2103+
20992104 const popupContainer = document.createElement('div');
21002105 popupContainer.innerHTML = safeValue;
21012106 popupContainer.appendChild(buttonContainerscrollableContainer);
2107+
2108+ // Ensure the popup uses flex layout
2109+ popupContainer.style.display = 'flex';
2110+ popupContainer.style.flexDirection = 'column';
2111+ popupContainer.style.maxHeight = '80vh'; // Limit the overall height of the popup
21022112
21032113 popup = new Popup(popupContainer, POPUP_TYPE.TEXT, '', { okButton: 'Cancel', allowVerticalScrolling: true });
21042114 popup.show()
public/scripts/textgen-models.js+24 -11
@@ -23,29 +23,42 @@ export let openRouterModels = [];
2323const OPENROUTER_PROVIDERS = [
2424 'OpenAI',
2525 'Anthropic',
26- 'HuggingFace',
2726 'Google',
2827 'MancerGoogle AI Studio',
2928 'Mancer 2Groq',
29+ 'SambaNova',
30+ 'Cohere',
31+ 'Mistral',
3032 'Together',
33+ 'Together 2',
34+ 'Fireworks',
3135 'DeepInfra',
36+ 'Lepton',
37+ 'Novita',
38+ 'Avian',
39+ 'Lambda',
3240 'Azure',
3341 'Modal',
3442 'AnyScale',
3543 'Replicate',
3644 'Perplexity',
3745 'Recursal',
38- 'Fireworks',
39- 'Mistral',
40- 'Groq',
41- 'Cohere',
42- 'Lepton',
4346 'OctoAI',
44- 'Novita',
45- 'Lynn',
46- 'Lynn 2',
4747 'DeepSeek',
4848 'Infermatic',
49+ 'AI21',
50+ 'Featherless',
51+ 'Inflection',
52+ 'xAI',
53+ '01.AI',
54+ 'HuggingFace',
55+ 'Mancer',
56+ 'Mancer 2',
57+ 'Hyperbolic',
58+ 'Hyperbolic 2',
59+ 'Lynn 2',
60+ 'Lynn',
61+ 'Reflection',
4962];
5063
5164export async function loadOllamaModels(data) {
public/style.css+1 -0
@@ -9,6 +9,7 @@
99@import url(css/logprobs.css);
1010@import url(css/accounts.css);
1111@import url(css/tags.css);
12+@import url(css/scrollable-button.css);
1213
1314:root {
1415 --doc-height: 100%;