Merge pull request #4057 from omahs/patch-2 Fix typos
Signed| @@ -8566,7 +8566,7 @@ export function showSwipeButtons() { | ||
| 8566 | 8566 | |
| 8567 | 8567 | //had to add this to make the swipe counter work |
| 8568 | 8568 | //(copied from the onclick functions for swipe buttons.. |
| 8569 | 8569 | //don't know why the array isn't set for non-swipe messsagesmessages in Generate or addOneMessage..) |
| 8570 | 8570 | if (chat[chat.length - 1]['swipe_id'] === undefined) { // if there is no swipe-message in the last spot of the chat array |
| 8571 | 8571 | chat[chat.length - 1]['swipe_id'] = 0; // set it to id 0 |
| 8572 | 8572 | chat[chat.length - 1]['swipes'] = []; // empty the array |
| @@ -279,9 +279,9 @@ export class TextCompletionService { | ||
| 279 | 279 | instructPreset, |
| 280 | 280 | ); |
| 281 | 281 | } else { // e.g. "<|im_start|>assistant: Hello, my name is" |
| 282 | 282 | const overridenInstructPresetoverriddenInstructPreset = structuredClone(instructPreset); |
| 283 | 283 | overridenInstructPresetoverriddenInstructPreset.output_suffix = ''; |
| 284 | 284 | overridenInstructPresetoverriddenInstructPreset.wrap = false; |
| 285 | 285 | messageContent = formatInstructModeChat( |
| 286 | 286 | message.role, |
| 287 | 287 | message.content, |
| @@ -291,7 +291,7 @@ export class TextCompletionService { | ||
| 291 | 291 | undefined, |
| 292 | 292 | undefined, |
| 293 | 293 | undefined, |
| 294 | 294 | overridenInstructPresetoverriddenInstructPreset, |
| 295 | 295 | ); |
| 296 | 296 | } |
| 297 | 297 | } |
| @@ -584,7 +584,7 @@ export function getNovelGenerationData(finalPrompt, settings, maxLength, isImper | ||
| 584 | 584 | }; |
| 585 | 585 | } |
| 586 | 586 | |
| 587 | 587 | // Check if the prefix needs to be overridenoverridden to use instruct mode |
| 588 | 588 | function selectPrefix(selected_prefix, finalPrompt) { |
| 589 | 589 | let useInstruct = false; |
| 590 | 590 | const clio = nai_settings.model_novel.includes('clio'); |
| @@ -132,7 +132,7 @@ function reloadUserAvatar(force = false) { | ||
| 132 | 132 | /** |
| 133 | 133 | * Sort the given personas |
| 134 | 134 | * @param {string[]} personas - The persona names to sort |
| 135 | 135 | * @returns {string[]} The sorted persona names arrrayarray, same reference as passed in |
| 136 | 136 | */ |
| 137 | 137 | function sortPersonas(personas) { |
| 138 | 138 | const option = $('#persona_sort_order').find(':selected'); |
| @@ -1821,7 +1821,7 @@ function registerPersonaSlashCommands() { | ||
| 1821 | 1821 | defaultValue: 'chat', |
| 1822 | 1822 | enumList: [ |
| 1823 | 1823 | new SlashCommandEnumValue('chat', 'Lock the persona to the current chat.'), |
| 1824 | 1824 | new SlashCommandEnumValue('character', 'Lock this persona to the currently selected character. If the setting is enabled, mutliplemultiple personas can be locked to the same character.'), |
| 1825 | 1825 | new SlashCommandEnumValue('default', 'Lock this persona as the default persona for all new chats.'), |
| 1826 | 1826 | ], |
| 1827 | 1827 | }), |
| @@ -1857,7 +1857,7 @@ function registerPersonaSlashCommands() { | ||
| 1857 | 1857 | defaultValue: 'chat', |
| 1858 | 1858 | enumList: [ |
| 1859 | 1859 | new SlashCommandEnumValue('chat', 'Lock the persona to the current chat.'), |
| 1860 | 1860 | new SlashCommandEnumValue('character', 'Lock this persona to the currently selected character. If the setting is enabled, mutliplemultiple personas can be locked to the same character.'), |
| 1861 | 1861 | new SlashCommandEnumValue('default', 'Lock this persona as the default persona for all new chats.'), |
| 1862 | 1862 | ], |
| 1863 | 1863 | }), |
| @@ -315,7 +315,7 @@ export class Popup { | ||
| 315 | 315 | if (defaultButton) defaultButton.classList.add('menu_button_default'); |
| 316 | 316 | |
| 317 | 317 | // Styling differences depending on the popup type |
| 318 | 318 | // General styling for all types first, that might be overridenoverridden for specific types below |
| 319 | 319 | this.mainInput.style.display = 'none'; |
| 320 | 320 | this.inputControls.style.display = customInputs ? 'block' : 'none'; |
| 321 | 321 | this.closeButton.style.display = 'none'; |
| @@ -426,7 +426,7 @@ export class ReasoningHandler { | ||
| 426 | 426 | if (!this.#isParsingReasoning) |
| 427 | 427 | return mesChanged; |
| 428 | 428 | |
| 429 | 429 | // If we are in manual parsing mode, all currently streaming mes tokens will go theto the reasoning block |
| 430 | 430 | this.reasoning = parseTarget.slice(power_user.reasoning.prefix.length); |
| 431 | 431 | message.mes = ''; |
| 432 | 432 | |
| @@ -264,9 +264,9 @@ function countWords(str) { | ||
| 264 | 264 | * @param {string} type - The type of the message processing (e.g., 'append', 'continue', 'appendFinal', 'swipe'). |
| 265 | 265 | * @param {Object} characters - Object containing character data. |
| 266 | 266 | * @param {string} this_chid - The character id. |
| 267 | 267 | * @param {string} oldMesssageoldMessage - The old message that's being processed. |
| 268 | 268 | */ |
| 269 | 269 | async function statMesProcess(line, type, characters, this_chid, oldMesssageoldMessage) { |
| 270 | 270 | if (this_chid === undefined || characters[this_chid] === undefined) { |
| 271 | 271 | return; |
| 272 | 272 | } |
| @@ -295,7 +295,7 @@ async function statMesProcess(line, type, characters, this_chid, oldMesssage) { | ||
| 295 | 295 | stat.user_msg_count++; |
| 296 | 296 | stat.user_word_count += countWords(line.mes); |
| 297 | 297 | } else { |
| 298 | 298 | let oldLen = oldMesssageoldMessage.split(' ').length; |
| 299 | 299 | stat.user_word_count += countWords(line.mes) - oldLen; |
| 300 | 300 | } |
| 301 | 301 | } else { |
| @@ -305,7 +305,7 @@ async function statMesProcess(line, type, characters, this_chid, oldMesssage) { | ||
| 305 | 305 | stat.non_user_msg_count++; |
| 306 | 306 | stat.non_user_word_count += countWords(line.mes); |
| 307 | 307 | } else { |
| 308 | 308 | let oldLen = oldMesssageoldMessage.split(' ').length; |
| 309 | 309 | stat.non_user_word_count += countWords(line.mes) - oldLen; |
| 310 | 310 | } |
| 311 | 311 | } |
| @@ -917,7 +917,7 @@ function newTag(tagName) { | ||
| 917 | 917 | /** |
| 918 | 918 | * @typedef {object} PrintTagListOptions - Optional parameters for printing the tag list. |
| 919 | 919 | * @property {Tag[]|function(): Tag[]} [tags=undefined] - Optional override of tags that should be printed. Those will not be sorted. If no supplied, tags for the relevant character are printed. Can also be a function that returns the tags. |
| 920 | 920 | * @property {Tag|Tag[]} [addTag=undefined] - Optionally provide one or multiple tags that should be manually added to this print. Either to the overridenoverridden tag list or the found tags based on the entity/key. Will respect the tag exists check. |
| 921 | 921 | * @property {object|number|string} [forEntityOrKey=undefined] - Optional override for the chosen entity, otherwise the currently selected is chosen. Can be an entity with id property (character, group, tag), or directly an id or tag key. |
| 922 | 922 | * @property {boolean|string} [empty=true] - Whether the list should be initially empty. If a string string is provided, 'always' will always empty the list, otherwise it'll evaluate to a boolean. |
| 923 | 923 | * @property {boolean} [sort=true] - Whether the tags should be sorted via the sort function, or kept as is. |
| @@ -2316,7 +2316,7 @@ export function deleteWIOriginalDataValue(data, uid) { | ||
| 2316 | 2316 | /** |
| 2317 | 2317 | * Splits a given input string that contains one or more keywords or regexes, separated by commas. |
| 2318 | 2318 | * |
| 2319 | 2319 | * Each part can be a valid regex following the pattern `/myregex/flags` with optional flags. CommmasCommas inside the regex are allowed, slashes have to be escaped like this: `\/` |
| 2320 | 2320 | * If a regex doesn't stand alone, it is not treated as a regex. |
| 2321 | 2321 | * |
| 2322 | 2322 | * @param {string} input - One or multiple keywords or regexes, separated by commas |
| @@ -1048,7 +1048,7 @@ router.post('/edit', validateAvatarUrlMiddleware, async function (request, respo | ||
| 1048 | 1048 | return response.sendStatus(200); |
| 1049 | 1049 | } |
| 1050 | 1050 | catch { |
| 1051 | 1051 | console.error('An error occuredoccurred, character edit invalidated.'); |
| 1052 | 1052 | } |
| 1053 | 1053 | }); |
| 1054 | 1054 | |
| @@ -1094,7 +1094,7 @@ router.post('/edit-attribute', validateAvatarUrlMiddleware, async function (requ | ||
| 1094 | 1094 | await writeCharacterData(avatarPath, newCharJSON, targetFile, request); |
| 1095 | 1095 | return response.sendStatus(200); |
| 1096 | 1096 | } catch (err) { |
| 1097 | 1097 | console.error('An error occuredoccurred, character edit invalidated.', err); |
| 1098 | 1098 | } |
| 1099 | 1099 | }); |
| 1100 | 1100 | |