Merge branch 'staging' into feature/comfyGgufModels
| @@ -3019,9 +3019,9 @@ | ||
| 3019 | 3019 | } |
| 3020 | 3020 | }, |
| 3021 | 3021 | "node_modules/cross-spawn": { |
| 3022 | 3022 | "version": "7.0.35", |
| 3023 | 3023 | "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.35.tgz", |
| 3024 | 3024 | "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7ZVJrKKYunU38/76t0RMOulHOnUcbU9GbpWKAOZ0mhjr7CX6FVrH+UJrags1q15Fudc7G6w4FrAapSOekrgFQ3f/8gwMEuIft0aKq6Hug==", |
| 3025 | 3025 | "license": "MIT", |
| 3026 | 3026 | "dependencies": { |
| 3027 | 3027 | "path-key": "^3.1.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 | +} | |
| @@ -3026,6 +3026,7 @@ | ||
| 3026 | 3026 | <option value="codestral-latest">codestral-latest</option> |
| 3027 | 3027 | <option value="codestral-mamba-latest">codestral-mamba-latest</option> |
| 3028 | 3028 | <option value="pixtral-12b-latest">pixtral-12b-latest</option> |
| 3029 | + <option value="pixtral-large-latest">pixtral-large-latest</option> | |
| 3029 | 3030 | </optgroup> |
| 3030 | 3031 | <optgroup label="Sub-versions"> |
| 3031 | 3032 | <option value="open-mistral-nemo-2407">open-mistral-nemo-2407</option> |
| @@ -3040,10 +3041,12 @@ | ||
| 3040 | 3041 | <option value="mistral-medium-2312">mistral-medium-2312</option> |
| 3041 | 3042 | <option value="mistral-large-2402">mistral-large-2402</option> |
| 3042 | 3043 | <option value="mistral-large-2407">mistral-large-2407</option> |
| 3044 | + <option value="mistral-large-2411">mistral-large-2411</option> | |
| 3043 | 3045 | <option value="codestral-2405">codestral-2405</option> |
| 3044 | 3046 | <option value="codestral-2405-blue">codestral-2405-blue</option> |
| 3045 | 3047 | <option value="codestral-mamba-2407">codestral-mamba-2407</option> |
| 3046 | 3048 | <option value="pixtral-12b-2409">pixtral-12b-2409</option> |
| 3049 | + <option value="pixtral-large-2411">pixtral-large-2411</option> | |
| 3047 | 3050 | </optgroup> |
| 3048 | 3051 | <optgroup id="mistralai_other_models" label="Other"></optgroup> |
| 3049 | 3052 | </select> |
| @@ -6631,9 +6634,9 @@ | ||
| 6631 | 6634 | </div> |
| 6632 | 6635 | </div> |
| 6633 | 6636 | <div class="logprobs_panel_content inline-drawer-content flex-container flexFlowColumn"> |
| 6634 | 6637 | <small class="flex-container alignItemsCenter justifySpaceBetween flexNoWrap"> |
| 6635 | 6638 | <b data-i18n="Select a token to see alternatives considered by the AI.">Select a token to see alternatives considered by the AI.</b> |
| 6636 | 6639 | <button id="logprobsReroll" class="menu_button margin0" title="Reroll with the entire prefix" data-i18n="[title]Reroll with the entire prefix"> |
| 6637 | 6640 | <span class="fa-solid fa-redo logprobs_reroll"></span> |
| 6638 | 6641 | </button> |
| 6639 | 6642 | </small> |
| @@ -703,16 +703,13 @@ const isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1; | ||
| 703 | 703 | */ |
| 704 | 704 | function autoFitSendTextArea() { |
| 705 | 705 | 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; | |
| 711 | 709 | sendTextArea.style.height = `${newHeight}px`; |
| 712 | 710 | |
| 713 | 711 | if (!isFirefox) { |
| 714 | 712 | const newScrollTopchatBlock.scrollTop = Math.round(chatBlock.scrollHeight - (chatBlock.offsetHeight + originalScrollBottom)); |
| 715 | - chatBlock.scrollTop = newScrollTop; | |
| 716 | 713 | } |
| 717 | 714 | } |
| 718 | 715 | export const autoFitSendTextAreaDebounced = debounce(autoFitSendTextArea, debounce_timeout.short); |
| @@ -37,6 +37,8 @@ | ||
| 37 | 37 | <select id="caption_multimodal_model" class="flex1 text_pole"> |
| 38 | 38 | <option data-type="mistral" value="pixtral-12b-latest">pixtral-12b-latest</option> |
| 39 | 39 | <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> | |
| 40 | 42 | <option data-type="zerooneai" value="yi-vision">yi-vision</option> |
| 41 | 43 | <option data-type="openai" value="gpt-4-vision-preview">gpt-4-vision-preview</option> |
| 42 | 44 | <option data-type="openai" value="gpt-4-turbo">gpt-4-turbo</option> |
| @@ -23,7 +23,7 @@ import { | ||
| 23 | 23 | import { collapseNewlines, registerDebugFunction } from '../../power-user.js'; |
| 24 | 24 | import { SECRET_KEYS, secret_state, writeSecret } from '../../secrets.js'; |
| 25 | 25 | import { getDataBankAttachments, getDataBankAttachmentsForSource, getFileAttachment } from '../../chats.js'; |
| 26 | 26 | import { debounce, getStringHash as calculateHash, waitUntilCondition, onlyUnique, splitRecursive, trimToStartSentence, trimToEndSentence, escapeHtml } from '../../utils.js'; |
| 27 | 27 | import { debounce_timeout } from '../../constants.js'; |
| 28 | 28 | import { getSortedEntries } from '../../world-info.js'; |
| 29 | 29 | import { textgen_types, textgenerationwebui_settings } from '../../textgen-settings.js'; |
| @@ -44,6 +44,9 @@ const MODULE_NAME = 'vectors'; | ||
| 44 | 44 | export const EXTENSION_PROMPT_TAG = '3_vectors'; |
| 45 | 45 | export const EXTENSION_PROMPT_TAG_DB = '4_vectors_data_bank'; |
| 46 | 46 | |
| 47 | +// Force solo chunks for sources that don't support batching. | |
| 48 | +const getBatchSize = () => ['transformers', 'palm', 'ollama'].includes(settings.source) ? 1 : 5; | |
| 49 | + | |
| 47 | 50 | const settings = { |
| 48 | 51 | // For both |
| 49 | 52 | source: 'transformers', |
| @@ -125,7 +128,7 @@ async function onVectorizeAllClick() { | ||
| 125 | 128 | // upon request of a full vectorise |
| 126 | 129 | cachedSummaries.clear(); |
| 127 | 130 | |
| 128 | 131 | const batchSize = 5getBatchSize(); |
| 129 | 132 | const elapsedLog = []; |
| 130 | 133 | let finished = false; |
| 131 | 134 | $('#vectorize_progress').show(); |
| @@ -560,7 +563,9 @@ async function vectorizeFile(fileText, fileName, collectionId, chunkSize, overla | ||
| 560 | 563 | fileText = translatedText; |
| 561 | 564 | } |
| 562 | 565 | |
| 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 }); | |
| 564 | 569 | const overlapSize = Math.round(chunkSize * overlapPercent / 100); |
| 565 | 570 | const delimiters = getChunkDelimiters(); |
| 566 | 571 | // 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 | ||
| 569 | 574 | console.debug(`Vectors: Split file ${fileName} into ${chunks.length} chunks with ${overlapPercent}% overlap`, chunks); |
| 570 | 575 | |
| 571 | 576 | 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 | + } | |
| 573 | 583 | |
| 574 | 584 | toastr.clear(toast); |
| 575 | 585 | console.log(`Vectors: Inserted ${chunks.length} vector items for file ${fileName} into ${collectionId}`); |
| @@ -1050,7 +1060,7 @@ async function onViewStatsClick() { | ||
| 1050 | 1060 | toastr.info(`Total hashes: <b>${totalHashes}</b><br> |
| 1051 | 1061 | Unique hashes: <b>${uniqueHashes}</b><br><br> |
| 1052 | 1062 | I'll mark collected messages with a green circle.`, |
| 1053 | 1063 | `Stats for chat ${escapeHtml(chatId)}`, |
| 1054 | 1064 | { timeOut: 10000, escapeHtml: false }, |
| 1055 | 1065 | ); |
| 1056 | 1066 | |
| @@ -4165,7 +4165,7 @@ async function onModelChange() { | ||
| 4165 | 4165 | $('#openai_max_context').attr('max', unlocked_max); |
| 4166 | 4166 | } else if (oai_settings.mistralai_model.includes('codestral-mamba')) { |
| 4167 | 4167 | $('#openai_max_context').attr('max', max_256k); |
| 4168 | 4168 | } else if (['mistral-large-2407', 'mistral-large-2411', 'mistral-large-latest'].includes(oai_settings.mistralai_model)) { |
| 4169 | 4169 | $('#openai_max_context').attr('max', max_128k); |
| 4170 | 4170 | } else if (oai_settings.mistralai_model.includes('mistral-nemo')) { |
| 4171 | 4171 | $('#openai_max_context').attr('max', max_128k); |
| @@ -4764,6 +4764,8 @@ export function isImageInliningSupported() { | ||
| 4764 | 4764 | 'pixtral-12b-latest', |
| 4765 | 4765 | 'pixtral-12b', |
| 4766 | 4766 | 'pixtral-12b-2409', |
| 4767 | + 'pixtral-large-latest', | |
| 4768 | + 'pixtral-large-2411', | |
| 4767 | 4769 | ]; |
| 4768 | 4770 | |
| 4769 | 4771 | switch (oai_settings.chat_completion_source) { |
| @@ -2083,7 +2083,10 @@ async function buttonsCallback(args, text) { | ||
| 2083 | 2083 | let popup; |
| 2084 | 2084 | |
| 2085 | 2085 | const buttonContainer = document.createElement('div'); |
| 2086 | 2086 | buttonContainer.classList.add('flex-container', 'flexFlowColumn', 'wide100p', 'm-t-1'); |
| 2087 | + | |
| 2088 | + const scrollableContainer = document.createElement('div'); | |
| 2089 | + scrollableContainer.classList.add('scrollable-buttons-container'); | |
| 2087 | 2090 | |
| 2088 | 2091 | for (const [result, button] of resultToButtonMap) { |
| 2089 | 2092 | const buttonElement = document.createElement('div'); |
| @@ -2096,9 +2099,16 @@ async function buttonsCallback(args, text) { | ||
| 2096 | 2099 | buttonContainer.appendChild(buttonElement); |
| 2097 | 2100 | } |
| 2098 | 2101 | |
| 2102 | + scrollableContainer.appendChild(buttonContainer); | |
| 2103 | + | |
| 2099 | 2104 | const popupContainer = document.createElement('div'); |
| 2100 | 2105 | popupContainer.innerHTML = safeValue; |
| 2101 | 2106 | 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 | |
| 2102 | 2112 | |
| 2103 | 2113 | popup = new Popup(popupContainer, POPUP_TYPE.TEXT, '', { okButton: 'Cancel', allowVerticalScrolling: true }); |
| 2104 | 2114 | popup.show() |
| @@ -23,29 +23,42 @@ export let openRouterModels = []; | ||
| 23 | 23 | const OPENROUTER_PROVIDERS = [ |
| 24 | 24 | 'OpenAI', |
| 25 | 25 | 'Anthropic', |
| 26 | - 'HuggingFace', | |
| 27 | 26 | 'Google', |
| 28 | 27 | 'MancerGoogle AI Studio', |
| 29 | 28 | 'Mancer 2Groq', |
| 29 | + 'SambaNova', | |
| 30 | + 'Cohere', | |
| 31 | + 'Mistral', | |
| 30 | 32 | 'Together', |
| 33 | + 'Together 2', | |
| 34 | + 'Fireworks', | |
| 31 | 35 | 'DeepInfra', |
| 36 | + 'Lepton', | |
| 37 | + 'Novita', | |
| 38 | + 'Avian', | |
| 39 | + 'Lambda', | |
| 32 | 40 | 'Azure', |
| 33 | 41 | 'Modal', |
| 34 | 42 | 'AnyScale', |
| 35 | 43 | 'Replicate', |
| 36 | 44 | 'Perplexity', |
| 37 | 45 | 'Recursal', |
| 38 | - 'Fireworks', | |
| 39 | - 'Mistral', | |
| 40 | - 'Groq', | |
| 41 | - 'Cohere', | |
| 42 | - 'Lepton', | |
| 43 | 46 | 'OctoAI', |
| 44 | - 'Novita', | |
| 45 | - 'Lynn', | |
| 46 | - 'Lynn 2', | |
| 47 | 47 | 'DeepSeek', |
| 48 | 48 | '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', | |
| 49 | 62 | ]; |
| 50 | 63 | |
| 51 | 64 | export async function loadOllamaModels(data) { |
| @@ -9,6 +9,7 @@ | ||
| 9 | 9 | @import url(css/logprobs.css); |
| 10 | 10 | @import url(css/accounts.css); |
| 11 | 11 | @import url(css/tags.css); |
| 12 | +@import url(css/scrollable-button.css); | |
| 12 | 13 | |
| 13 | 14 | :root { |
| 14 | 15 | --doc-height: 100%; |