Merge remote-tracking branch 'alpin/staging' into sampler_order
| @@ -1,12 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "name": "sillytavern", |
| 3 | 3 | "version": "1.12.78", |
| 4 | 4 | "lockfileVersion": 3, |
| 5 | 5 | "requires": true, |
| 6 | 6 | "packages": { |
| 7 | 7 | "": { |
| 8 | 8 | "name": "sillytavern", |
| 9 | 9 | "version": "1.12.78", |
| 10 | 10 | "hasInstallScript": true, |
| 11 | 11 | "license": "AGPL-3.0", |
| 12 | 12 | "dependencies": { |
| @@ -84,7 +84,7 @@ | ||
| 84 | 84 | "type": "git", |
| 85 | 85 | "url": "https://github.com/SillyTavern/SillyTavern.git" |
| 86 | 86 | }, |
| 87 | 87 | "version": "1.12.78", |
| 88 | 88 | "scripts": { |
| 89 | 89 | "start": "node server.js", |
| 90 | 90 | "start:deno": "deno run --allow-run --allow-net --allow-read --allow-write --allow-sys --allow-env server.js", |
| @@ -820,8 +820,8 @@ | ||
| 820 | 820 | </div> |
| 821 | 821 | </div> |
| 822 | 822 | <div class="range-block m-t-1"> |
| 823 | 823 | <div class="range-block-title openai_restorable" data-i18n="World Info Format Template"> |
| 824 | 824 | <span data-i18n="World Info Format Template">World Info format template</span> |
| 825 | 825 | <div id="wi_format_restore" data-i18n="[title]Restore default format" title="Restore default format" class="right_menu_button"> |
| 826 | 826 | <div class="fa-solid fa-clock-rotate-left"></div> |
| 827 | 827 | </div> |
| @@ -1524,15 +1524,15 @@ | ||
| 1524 | 1524 | <div class=""> |
| 1525 | 1525 | <label class="checkbox_label" for="early_stopping_textgenerationwebui"> |
| 1526 | 1526 | <input type="checkbox" id="early_stopping_textgenerationwebui" /> |
| 1527 | 1527 | <small data-i18n="Early Stopping">Early Stopping</small> |
| 1528 | 1528 | <div class="fa-solid fa-circle-info opacity50p" data-i18n="[title]Controls the stopping condition for beam search. If checked, the generation stops as soon as there are '# of Beams' sequences. If not checked, a heuristic is applied and the generation is stopped when it's very unlikely to find better candidates." title="Controls the stopping condition for beam search. If checked, the generation stops as soon as there are '# of Beams' sequences. If not checked, a heuristic is applied and the generation is stopped when it's very unlikely to find better candidates."></div> |
| 1529 | - </small> | |
| 1530 | 1529 | </label> |
| 1531 | 1530 | </div> |
| 1532 | 1531 | </div> |
| 1533 | 1532 | </div> |
| 1534 | 1533 | <div data-tg-type="ooba" id="contrastiveSearchBlock" name="contrastiveSearchBlock" class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0"> |
| 1535 | 1534 | <h4 class="textAlignCenter" data-i18n="Contrastive search">Contrastive Search |
| 1535 | + <span data-i18n="Contrastive search">Contrastive Search</span> | |
| 1536 | 1536 | <div class=" fa-solid fa-circle-info opacity50p " data-i18n="Contrastive_search_txt" title="A sampler that encourages diversity while maintaining coherence, by exploiting the isotropicity of the representation space of most LLMs. For details, see the paper A Contrastive Framework for Neural Text Generation by Su et al. (2022)."></div> |
| 1537 | 1537 | </h4> |
| 1538 | 1538 | <div class="alignitemscenter flex-container flexFlowColumn wide100p gap0"> |
| @@ -1566,9 +1566,8 @@ | ||
| 1566 | 1566 | </label> |
| 1567 | 1567 | <label data-tg-type="vllm, aphrodite, infermaticai" class="checkbox_label" for="ignore_eos_token_textgenerationwebui"> |
| 1568 | 1568 | <input type="checkbox" id="ignore_eos_token_textgenerationwebui" /> |
| 1569 | 1569 | <small data-i18n="Ignore EOS Token">Ignore EOS Token</small> |
| 1570 | 1570 | <div class="fa-solid fa-circle-info opacity50p " data-i18n="[title]Ignore the EOS Token even if it generates." title="Ignore the EOS Token even if it generates."></div> |
| 1571 | - </small> | |
| 1572 | 1571 | </label> |
| 1573 | 1572 | <label class="checkbox_label flexGrow flexShrink" for="skip_special_tokens_textgenerationwebui"> |
| 1574 | 1573 | <input type="checkbox" id="skip_special_tokens_textgenerationwebui" /> |
| @@ -1629,7 +1628,8 @@ | ||
| 1629 | 1628 | </div> |
| 1630 | 1629 | <div id="cfg_block_ooba" data-tg-type="ooba, tabby" class="wide100p"> |
| 1631 | 1630 | <hr class="width100p"> |
| 1632 | 1631 | <h4 data-i18n="CFG" class="textAlignCenter">CFG |
| 1632 | + <span data-i18n="CFG">CFG</span> | |
| 1633 | 1633 | <div class="margin5 fa-solid fa-circle-info opacity50p " data-i18n="[title]Classifier Free Guidance. More helpful tip coming soon" title="Classifier Free Guidance. More helpful tip coming soon."></div> |
| 1634 | 1634 | </h4> |
| 1635 | 1635 | <div class="alignitemscenter flex-container flexFlowColumn flexShrink gap0"> |
| @@ -2032,8 +2032,10 @@ | ||
| 2032 | 2032 | <div id="logit_bias_openai" class="range-block-title openai_restorable" data-i18n="Logit Bias"> |
| 2033 | 2033 | Logit Bias |
| 2034 | 2034 | </div> |
| 2035 | 2035 | <div class="toggle-description justifyLeft" data-i18n="Helps to ban or reenforce the usage of certain words"> |
| 2036 | 2036 | <span data-i18n="Helps to ban or reinforcereenforce the usage of certain tokens.words">Helps Confirmto tokenban parsingor withreinforce <athe target="_blank"usage href="https://platform.openaiof certain tokens.com/tokenizer/">Tokenizer</aspan>. |
| 2037 | + <span data-i18n="Confirm token parsing with">Confirm token parsing with</span> | |
| 2038 | + <a target="_blank" href="https://platform.openai.com/tokenizer/" data-i18n="Tokenizer">Tokenizer</a>. | |
| 2037 | 2039 | </div> |
| 2038 | 2040 | <div class="openai_logit_bias_preset_form"> |
| 2039 | 2041 | <select id="openai_logit_bias_preset"> |
| @@ -2334,8 +2336,8 @@ | ||
| 2334 | 2336 | <div data-tg-type="mancer" class="flex-container flexFlowColumn"> |
| 2335 | 2337 | <div class="flex-container flexFlowColumn"> |
| 2336 | 2338 | </div> |
| 2337 | - <h4 data-i18n="Mancer API key"> | |
| 2339 | + <h4> | |
| 2338 | - Mancer API key | |
| 2340 | + <span data-i18n="Mancer API key">Mancer API key</span> | |
| 2339 | 2341 | <a href="https://mancer.tech/" class="notes-link" target="_blank"> |
| 2340 | 2342 | <span class="fa-solid fa-circle-question note-link-span"></span> |
| 2341 | 2343 | </a> |
| @@ -2631,15 +2633,21 @@ | ||
| 2631 | 2633 | <input id="koboldcpp_api_url_text" class="text_pole wide100p" value="" autocomplete="off" data-server-history="koboldcpp"> |
| 2632 | 2634 | </div> |
| 2633 | 2635 | </div> |
| 2636 | + <div class="flex-container flexFlowColumn marginTopBot5"> | |
| 2637 | + <label data-tg-type="ooba" class="checkbox_label" for="bypass_status_check_textgenerationwebui"> | |
| 2638 | + <input type="checkbox" id="bypass_status_check_textgenerationwebui" /> | |
| 2639 | + <span data-i18n="Bypass status check">Bypass status check</span> | |
| 2640 | + </label> | |
| 2641 | + <label data-tg-type="koboldcpp, llamacpp" class="checkbox_label" for="context_size_derived"> | |
| 2642 | + <input type="checkbox" id="context_size_derived" /> | |
| 2643 | + <span data-i18n="Derive context size from backend">Derive context size from backend</span> | |
| 2644 | + </label> | |
| 2645 | + </div> | |
| 2634 | 2646 | <div class="flex-container"> |
| 2635 | 2647 | <div id="api_button_textgenerationwebui" class="api_button menu_button menu_button_icon" type="submit" data-i18n="Connect" data-server-connect="ooba_blocking,vllm,aphrodite,tabby,koboldcpp,ollama,llamacpp,huggingface">Connect</div> |
| 2636 | 2648 | <div data-tg-type="openrouter" class="menu_button menu_button_icon openrouter_authorize" title="Get your OpenRouter API token using OAuth flow. You will be redirected to openrouter.ai" data-i18n="Authorize;[title]Get your OpenRouter API token using OAuth flow. You will be redirected to openrouter.ai">Authorize</div> |
| 2637 | 2649 | <div class="api_loading menu_button menu_button_icon" data-i18n="Cancel">Cancel</div> |
| 2638 | 2650 | </div> |
| 2639 | - <label data-tg-type="ooba" class="checkbox_label margin-bot-10px" for="bypass_status_check_textgenerationwebui"> | |
| 2640 | - <input type="checkbox" id="bypass_status_check_textgenerationwebui" /> | |
| 2641 | - <span data-i18n="Bypass status check">Bypass status check</span> | |
| 2642 | - </label> | |
| 2643 | 2651 | </form> |
| 2644 | 2652 | <div class="online_status"> |
| 2645 | 2653 | <div class="online_status_indicator"></div> |
| @@ -2682,8 +2690,9 @@ | ||
| 2682 | 2690 | </div> |
| 2683 | 2691 | <div class="toggle-description justifyLeft"> |
| 2684 | 2692 | <span data-i18n="Saved addresses and passwords."> |
| 2685 | 2693 | Saved addresses and passwords.<br> |
| 2686 | 2694 | </span> |
| 2695 | + <br> | |
| 2687 | 2696 | </div> |
| 2688 | 2697 | <div class="openai_logit_bias_preset_form"> |
| 2689 | 2698 | <select id="openai_proxy_preset"> |
| @@ -2696,8 +2705,9 @@ | ||
| 2696 | 2705 | </div> |
| 2697 | 2706 | <div class="toggle-description justifyLeft"> |
| 2698 | 2707 | <span data-i18n="This will show up as your saved preset."> |
| 2699 | 2708 | This will show up as your saved preset.<br> |
| 2700 | 2709 | </span> |
| 2710 | + <br> | |
| 2701 | 2711 | </div> |
| 2702 | 2712 | <div class="wide100p"> |
| 2703 | 2713 | <input id="openai_reverse_proxy_name" type="text" class="text_pole" placeholder="..." /> |
| @@ -2707,8 +2717,9 @@ | ||
| 2707 | 2717 | </div> |
| 2708 | 2718 | <div class="toggle-description justifyLeft wide100p"> |
| 2709 | 2719 | <span data-i18n="Alternative server URL (leave empty to use the default value)."> |
| 2710 | 2720 | Alternative server URL (leave empty to use the default value).<br> |
| 2711 | 2721 | </span> |
| 2722 | + <br> | |
| 2712 | 2723 | </div> |
| 2713 | 2724 | <div class="wide100p"> |
| 2714 | 2725 | <input id="openai_reverse_proxy" type="text" class="text_pole" placeholder="https://api.openai.com/v1" /> |
| @@ -2721,8 +2732,9 @@ | ||
| 2721 | 2732 | </div> |
| 2722 | 2733 | <div class="toggle-description justifyLeft"> |
| 2723 | 2734 | <span data-i18n="Will be used as a password for the proxy instead of API key."> |
| 2724 | 2735 | Will be used as a password for the proxy instead of API key.<br> |
| 2725 | 2736 | </span> |
| 2737 | + <br> | |
| 2726 | 2738 | </div> |
| 2727 | 2739 | <div class="flex-container width100p"> |
| 2728 | 2740 | <input id="openai_proxy_password" type="password" class="text_pole flex1" placeholder="" form="openai_form" autocomplete="off" /> |
| @@ -3810,7 +3822,11 @@ | ||
| 3810 | 3822 | <div id="wiTopBlock" class="flex-container"> |
| 3811 | 3823 | <div id="WIMultiSelector" class="flex1 flex alignSelfStart range-block"> |
| 3812 | 3824 | <div class="range-block-title justifyLeft"> |
| 3813 | - <span data-i18n="Active World(s) for all chats"><small>Active World(s) for all chats</small></span> | |
| 3825 | + <span> | |
| 3826 | + <small data-i18n="Active World(s) for all chats"> | |
| 3827 | + Active World(s) for all chats | |
| 3828 | + </small> | |
| 3829 | + </span> | |
| 3814 | 3830 | </div> |
| 3815 | 3831 | <div class="range-block-range"> |
| 3816 | 3832 | <select id="world_info" class="select2_multi_sameline" multiple> |
| @@ -4135,7 +4151,10 @@ | ||
| 4135 | 4151 | |
| 4136 | 4152 | <div class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0"> |
| 4137 | 4153 | <small> |
| 4138 | - <span data-i18n="Chat Width">Chat Width <i class="fa-solid fa-desktop"></i></span> | |
| 4154 | + <span> | |
| 4155 | + <span data-i18n="Chat Width">Chat Width</span> | |
| 4156 | + <i class="fa-solid fa-desktop"></i> | |
| 4157 | + </span> | |
| 4139 | 4158 | <div class="fa-solid fa-circle-info opacity50p" data-i18n="[title]Width of the main chat window in % of screen width" title="Width of the main chat window in % of screen width"></div> |
| 4140 | 4159 | </small> |
| 4141 | 4160 | <input class="neo-range-slider" type="range" id="chat_width_slider" name="chat_width_slider" min="25" max="100" step="1"> |
| @@ -4307,7 +4326,7 @@ | ||
| 4307 | 4326 | <div id="reload_chat" class="menu_button whitespacenowrap" data-i18n="[title]Reload and redraw the currently open chat" title="Reload and redraw the currently open chat."> |
| 4308 | 4327 | <small data-i18n="Reload Chat">Reload Chat</small> |
| 4309 | 4328 | </div> |
| 4310 | 4329 | <div id="debug_menu" class="menu_button whitespacenowrap" data-i18n="Debug Menu"> |
| 4311 | 4330 | <small data-i18n="Debug Menu">Debug Menu</small> |
| 4312 | 4331 | </div> |
| 4313 | 4332 | </div> |
| @@ -4426,8 +4445,10 @@ | ||
| 4426 | 4445 | </div> |
| 4427 | 4446 | </div> |
| 4428 | 4447 | <div id="examples-behavior-block"> |
| 4429 | - <label data-i18n="Example Messages Behavior"> | |
| 4448 | + <label> | |
| 4430 | 4449 | <small> data-i18n="Example Messages Behavior:</small"> |
| 4450 | + Example Messages Behavior: | |
| 4451 | + </small> | |
| 4431 | 4452 | </label> |
| 4432 | 4453 | <select id="example_messages_behavior"> |
| 4433 | 4454 | <option value="normal" data-i18n="Gradual push-out">Gradual push-out</option> |
| @@ -4591,7 +4612,9 @@ | ||
| 4591 | 4612 | </label> |
| 4592 | 4613 | <div class="flex-container"> |
| 4593 | 4614 | <div class="flex1" title="Determines how entries are found for autocomplete." data-i18n="[title]Determines how entries are found for autocomplete."> |
| 4594 | - <label for="stscript_matching" data-i18n="Autocomplete Matching"><small>Matching</small></label> | |
| 4615 | + <label for="stscript_matching"> | |
| 4616 | + <small data-i18n="Autocomplete Matching">Matching</small> | |
| 4617 | + </label> | |
| 4595 | 4618 | <select id="stscript_matching"> |
| 4596 | 4619 | <option data-i18n="Starts with" value="strict">Starts with</option> |
| 4597 | 4620 | <option data-i18n="Includes" value="includes">Includes</option> |
| @@ -4599,7 +4622,9 @@ | ||
| 4599 | 4622 | </select> |
| 4600 | 4623 | </div> |
| 4601 | 4624 | <div class="flex1" title="Sets the style of the autocomplete." data-i18n="[title]Sets the style of the autocomplete."> |
| 4602 | - <label for="stscript_autocomplete_style" data-i18n="Autocomplete Style"><small>Style</small></label> | |
| 4625 | + <label for="stscript_autocomplete_style"> | |
| 4626 | + <small data-i18n="Autocomplete Style">Style</small> | |
| 4627 | + </label> | |
| 4603 | 4628 | <div class="flex-container flexFlowRow alignItemsBaseline"> |
| 4604 | 4629 | <select id="stscript_autocomplete_style"> |
| 4605 | 4630 | <option data-i18n="Follow Theme" value="theme">Follow Theme</option> |
| @@ -4611,8 +4636,8 @@ | ||
| 4611 | 4636 | </div> |
| 4612 | 4637 | </div> |
| 4613 | 4638 | <div title="Determines which keys select an item from the AutoComplete suggestions"> |
| 4614 | 4639 | <label data-i18n="Keyboard"> |
| 4615 | 4640 | <small data-i18n="Keyboard">Keyboard:</small> |
| 4616 | 4641 | </label> |
| 4617 | 4642 | <select id="stscript_autocomplete_select"> |
| 4618 | 4643 | <option value="3" data-i18n="Select with Tab or Enter">Select with Tab or Enter</option> |
| @@ -4626,7 +4651,9 @@ | ||
| 4626 | 4651 | <input class="neo-range-input" type="number" min="0.5" max="2" step="0.01" data-for="stscript_autocomplete_font_scale" id="stscript_autocomplete_font_scale_counter"> |
| 4627 | 4652 | </div> |
| 4628 | 4653 | <div title="Sets the width of the autocomplete." data-i18n="[title]Sets the width of the autocomplete."> |
| 4629 | - <label for="stscript_autocomplete_width" data-i18n="Autocomplete Width"><small>Width</small></label> | |
| 4654 | + <label for="stscript_autocomplete_width"> | |
| 4655 | + <small data-i18n="Autocomplete Width">Width</small> | |
| 4656 | + </label> | |
| 4630 | 4657 | <div class="doubleRangeContainer"> |
| 4631 | 4658 | <div class="doubleRangeInputContainer"> |
| 4632 | 4659 | <input type="range" id="stscript_autocomplete_width_left" min="0" max="2" step="1"> |
| @@ -4654,14 +4681,18 @@ | ||
| 4654 | 4681 | <label><small data-i18n="Parser Flags">Parser Flags</small></label> |
| 4655 | 4682 | <label class="checkbox_label" title="Switch to stricter escaping, allowing all delimiting characters to be escaped with a backslash, and backslashes to be escaped as well." data-i18n="[title]Switch to stricter escaping, allowing all delimiting characters to be escaped with a backslash, and backslashes to be escaped as well."> |
| 4656 | 4683 | <input id="stscript_parser_flag_strict_escaping" type="checkbox" /> |
| 4657 | - <span data-i18n="STRICT_ESCAPING"><small>STRICT_ESCAPING</small></span> | |
| 4684 | + <span> | |
| 4685 | + <small data-i18n="STRICT_ESCAPING">STRICT_ESCAPING</small> | |
| 4686 | + </span> | |
| 4658 | 4687 | <a href="https://docs.sillytavern.app/usage/st-script/#strict-escaping" target="_blank" class="notes-link"> |
| 4659 | 4688 | <span class="fa-solid fa-circle-question note-link-span"></span> |
| 4660 | 4689 | </a> |
| 4661 | 4690 | </label> |
| 4662 | 4691 | <label class="checkbox_label" title="Prevents {{getvar::}} {{getglobalvar::}} macros from having literal macro-like values auto-evaluated.
e.g. "{{newline}}" remains as literal string "{{newline}}"

(This is done by internally replacing {{getvar::}} {{getglobalvar::}} macros with scoped variables.)" data-i18n="[title]stscript_parser_flag_replace_getvar_label"> |
| 4663 | 4692 | <input id="stscript_parser_flag_replace_getvar" type="checkbox" /> |
| 4664 | - <span data-i18n="REPLACE_GETVAR"><small>REPLACE_GETVAR</small></span> | |
| 4693 | + <span> | |
| 4694 | + <small data-i18n="REPLACE_GETVAR">REPLACE_GETVAR</small> | |
| 4695 | + </span> | |
| 4665 | 4696 | <a href="https://docs.sillytavern.app/usage/st-script/#replace-variable-macros" target="_blank" class="notes-link"> |
| 4666 | 4697 | <span class="fa-solid fa-circle-question note-link-span"></span> |
| 4667 | 4698 | </a> |
| @@ -4792,10 +4823,12 @@ | ||
| 4792 | 4823 | <div class="flex-container wide100p alignitemscenter spaceBetween flexNoGap"> |
| 4793 | 4824 | <div class="flex-container alignItemsBaseline wide100p"> |
| 4794 | 4825 | <div class="flex1 flex-container alignItemsBaseline"> |
| 4795 | 4826 | <h3 class="margin0" data-i18n="Persona Management">Persona Management</h3> |
| 4796 | - <a href="https://docs.sillytavern.app/usage/core-concepts/personas/" target="_blank" data-i18n="How do I use this?"> | |
| 4827 | + <span data-i18n="Persona Management">Persona Management</span> | |
| 4797 | - <span class="fa-solid fa-circle-question note-link-span"></span> | |
| 4828 | + <a href="https://docs.sillytavern.app/usage/core-concepts/personas/" target="_blank"> | |
| 4798 | - </a> | |
| 4829 | + <span class="fa-solid fa-circle-question note-link-span"></span> | |
| 4830 | + </a> | |
| 4831 | + </h3> | |
| 4799 | 4832 | </div> |
| 4800 | 4833 | <div class="flex-container"> |
| 4801 | 4834 | <div class="menu_button menu_button_icon user_stats_button" data-i18n="[title]Click for stats!" title="Click for stats!"> |
| @@ -5516,7 +5549,12 @@ | ||
| 5516 | 5549 | <span data-i18n="Examples of dialogue" class="mdhotkey_location">Examples of dialogue</span> |
| 5517 | 5550 | <i class="editor_maximize fa-solid fa-maximize right_menu_button" data-for="mes_example_textarea" title="Expand the editor" data-i18n="[title]Expand the editor"></i> |
| 5518 | 5551 | </h4> |
| 5519 | - <h5 data-i18n="Important to set the character's writing style.">Important to set the character's writing style. <a href="https://docs.sillytavern.app/usage/core-concepts/characterdesign/#examples-of-dialogue" class="notes-link" target="_blank"><span class="fa-solid fa-circle-question note-link-span"></span></a></h5> | |
| 5552 | + <h5> | |
| 5553 | + <span data-i18n="Important to set the character's writing style.">Important to set the character's writing style.</span> | |
| 5554 | + <a href="https://docs.sillytavern.app/usage/core-concepts/characterdesign/#examples-of-dialogue" class="notes-link" target="_blank"> | |
| 5555 | + <span class="fa-solid fa-circle-question note-link-span"></span> | |
| 5556 | + </a> | |
| 5557 | + </h5> | |
| 5520 | 5558 | </div> |
| 5521 | 5559 | <textarea id="mes_example_textarea" class="flexGrow mdHotkeys" name="mes_example" data-i18n="[placeholder](Examples of chat dialog. Begin each example with START on a new line.)" placeholder="(Examples of chat dialog. Begin each example with <START> on a new line.)" form="form_create" rows="6"></textarea> |
| 5522 | 5560 | <div class="extension_token_counter"> |
| @@ -5592,7 +5630,8 @@ | ||
| 5592 | 5630 | <div class="character_world range-block flexFlowColumn flex-container"> |
| 5593 | 5631 | <div class="range-block-title"> |
| 5594 | 5632 | <h3> |
| 5595 | 5633 | <span data-i18n="Select a World Info file for"> Select a World Info file for <span class="character_name"></span></span>: |
| 5634 | + <span class="character_name"></span>: | |
| 5596 | 5635 | </h3> |
| 5597 | 5636 | </div> |
| 5598 | 5637 | <h4 data-i18n="Primary Lorebook">Primary Lorebook</h4> |
| @@ -5893,7 +5932,7 @@ | ||
| 5893 | 5932 | </div> |
| 5894 | 5933 | <div class="flex2 flex-container flexFlowColumn flexNoGap" data-i18n="[title]Sticky entries will stay active for N messages after being triggered." title="Sticky entries will stay active for N messages after being triggered."> |
| 5895 | 5934 | <div class="flex-container justifySpaceBetween marginBot5"> |
| 5896 | 5935 | <small class="flex-container alignItemsBaseline" for="sticky" data-i18n="Sticky"> |
| 5897 | 5936 | <span data-i18n="Sticky"> |
| 5898 | 5937 | Sticky |
| 5899 | 5938 | </span> |
| @@ -5906,7 +5945,7 @@ | ||
| 5906 | 5945 | </div> |
| 5907 | 5946 | <div class="flex2 flex-container flexFlowColumn flexNoGap" data-i18n="[title]Entries with a cooldown can't be activated N messages after being triggered." title="Entries with a cooldown can't be activated N messages after being triggered."> |
| 5908 | 5947 | <div class="flex-container justifySpaceBetween marginBot5"> |
| 5909 | 5948 | <small class="flex-container alignItemsBaseline" for="cooldown" data-i18n="Cooldown"> |
| 5910 | 5949 | <span data-i18n="Cooldown"> |
| 5911 | 5950 | Cooldown |
| 5912 | 5951 | </span> |
| @@ -5919,7 +5958,7 @@ | ||
| 5919 | 5958 | </div> |
| 5920 | 5959 | <div class="flex2 flex-container flexFlowColumn flexNoGap" data-i18n="[title]Entries with a delay can't be activated until there are N messages present in the chat." title="Entries with a delay can't be activated until there are N messages present in the chat."> |
| 5921 | 5960 | <div class="flex-container justifySpaceBetween marginBot5"> |
| 5922 | 5961 | <small class="flex-container alignItemsBaseline" for="delay" data-i18n="Delay"> |
| 5923 | 5962 | <span data-i18n="Delay"> |
| 5924 | 5963 | Delay |
| 5925 | 5964 | </span> |
| @@ -242,7 +242,7 @@ import { BulkEditOverlay, CharacterContextMenu } from './scripts/BulkEditOverlay | ||
| 242 | 242 | import { loadFeatherlessModels, loadMancerModels, loadOllamaModels, loadTogetherAIModels, loadInfermaticAIModels, loadOpenRouterModels, loadVllmModels, loadAphroditeModels, loadDreamGenModels, initTextGenModels, loadTabbyModels } from './scripts/textgen-models.js'; |
| 243 | 243 | import { appendFileContent, hasPendingFileAttachment, populateFileAttachment, decodeStyleTags, encodeStyleTags, isExternalMediaAllowed, getCurrentEntityId, preserveNeutralChat, restoreNeutralChat } from './scripts/chats.js'; |
| 244 | 244 | import { initPresetManager } from './scripts/preset-manager.js'; |
| 245 | 245 | import { MacrosParser, evaluateMacros, getLastMessageId, initMacros } from './scripts/macros.js'; |
| 246 | 246 | import { currentUser, setUserControls } from './scripts/user.js'; |
| 247 | 247 | import { POPUP_RESULT, POPUP_TYPE, Popup, callGenericPopup, fixToastrForDialogs } from './scripts/popup.js'; |
| 248 | 248 | import { renderTemplate, renderTemplateAsync } from './scripts/templates.js'; |
| @@ -957,6 +957,7 @@ async function firstLoadInit() { | ||
| 957 | 957 | initDynamicStyles(); |
| 958 | 958 | initTags(); |
| 959 | 959 | initBookmarks(); |
| 960 | + initMacros(); | |
| 960 | 961 | await getUserAvatars(true, user_avatar); |
| 961 | 962 | await getCharacters(); |
| 962 | 963 | await getBackgrounds(); |
| @@ -1238,8 +1239,9 @@ async function getStatusTextgen() { | ||
| 1238 | 1239 | |
| 1239 | 1240 | const wantsInstructDerivation = (power_user.instruct.enabled && power_user.instruct.derived); |
| 1240 | 1241 | const wantsContextDerivation = power_user.context_derived; |
| 1242 | + const wantsContextSize = power_user.context_size_derived; | |
| 1241 | 1243 | const supportsChatTemplate = [textgen_types.KOBOLDCPP, textgen_types.LLAMACPP].includes(textgen_settings.type); |
| 1242 | 1244 | if (supportsChatTemplate && (wantsInstructDerivation || wantsContextDerivation || wantsContextSize)) { |
| 1243 | 1245 | const response = await fetch('/api/backends/text-completions/props', { |
| 1244 | 1246 | method: 'POST', |
| 1245 | 1247 | headers: getRequestHeaders(), |
| @@ -1253,6 +1255,17 @@ async function getStatusTextgen() { | ||
| 1253 | 1255 | const data = await response.json(); |
| 1254 | 1256 | if (data) { |
| 1255 | 1257 | const { chat_template, chat_template_hash } = data; |
| 1258 | + if (wantsContextSize && 'default_generation_settings' in data) { | |
| 1259 | + const backend_max_context = data['default_generation_settings']['n_ctx']; | |
| 1260 | + const old_value = max_context; | |
| 1261 | + if (max_context !== backend_max_context) { | |
| 1262 | + setGenerationParamsFromPreset({ max_length: backend_max_context }); | |
| 1263 | + } | |
| 1264 | + if (old_value !== max_context) { | |
| 1265 | + console.log(`Auto-switched max context from ${old_value} to ${max_context}`); | |
| 1266 | + toastr.info(`${old_value} ⇒ ${max_context}`, 'Context Size Changed'); | |
| 1267 | + } | |
| 1268 | + } | |
| 1256 | 1269 | console.log(`We have chat template ${chat_template.split('\n')[0]}...`); |
| 1257 | 1270 | const templates = await deriveTemplatesFromChatTemplate(chat_template, chat_template_hash); |
| 1258 | 1271 | if (templates) { |
| @@ -6822,6 +6835,10 @@ export async function saveSettings(type) { | ||
| 6822 | 6835 | }); |
| 6823 | 6836 | } |
| 6824 | 6837 | |
| 6838 | +/** | |
| 6839 | + * Sets the generation parameters from a preset object. | |
| 6840 | + * @param {{ genamt?: number, max_length?: number }} preset Preset object | |
| 6841 | + */ | |
| 6825 | 6842 | export function setGenerationParamsFromPreset(preset) { |
| 6826 | 6843 | const needsUnlock = (preset.max_length ?? max_context) > MAX_CONTEXT_DEFAULT || (preset.genamt ?? amount_gen) > MAX_RESPONSE_DEFAULT; |
| 6827 | 6844 | $('#max_context_unlocked').prop('checked', needsUnlock).trigger('change'); |
| @@ -40,7 +40,7 @@ | ||
| 40 | 40 | <div class="expression_fallback_block m-b-1 m-t-1"> |
| 41 | 41 | <label for="expression_fallback" data-i18n="Default / Fallback Expression">Default / Fallback Expression</label> |
| 42 | 42 | <small data-i18n="Set the default and fallback expression being used when no matching expression is found.">Set the default and fallback expression being used when no matching expression is found.</small> |
| 43 | 43 | <select id="expression_fallback" class="flex1 margin0" data-i18n="Fallback Expression" placeholder="Fallback Expression"></select> |
| 44 | 44 | </div> |
| 45 | 45 | <div class="expression_custom_block m-b-1 m-t-1"> |
| 46 | 46 | <label for="expression_custom" data-i18n="Custom Expressions">Custom Expressions</label> |
| @@ -57,7 +57,7 @@ | ||
| 57 | 57 | </div> |
| 58 | 58 | <div id="playback_rate_block" class="range-block"> |
| 59 | 59 | <hr> |
| 60 | 60 | <div class="range-block-title justifyLeft" data-i18n="Audio Playback Speed"> |
| 61 | 61 | <small data-i18n="Audio Playback Speed">Audio Playback Speed</small> |
| 62 | 62 | </div> |
| 63 | 63 | <div class="range-block-range-and-counter"> |
| @@ -80,4 +80,4 @@ | ||
| 80 | 80 | </div> |
| 81 | 81 | </div> |
| 82 | 82 | </div> |
| 83 | -</div> | |
| 83 | \ No newline at end of file | |
| 83 | +</div> | |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | import { Handlebars, moment, seedrandom, droll } from '../lib.js'; |
| 2 | 2 | import { chat, chat_metadata, main_api, getMaxContextSize, getCurrentChatId, substituteParams, eventSource, event_types } from '../script.js'; |
| 3 | 3 | import { timestampToMoment, isDigitsOnly, getStringHash, escapeRegex, uuidv4 } from './utils.js'; |
| 4 | 4 | import { textgenerationwebui_banned_in_macros } from './textgen-settings.js'; |
| 5 | 5 | import { getInstructMacros } from './instruct-mode.js'; |
| @@ -521,3 +521,22 @@ export function evaluateMacros(content, env, postProcessFn) { | ||
| 521 | 521 | |
| 522 | 522 | return content; |
| 523 | 523 | } |
| 524 | + | |
| 525 | +export function initMacros() { | |
| 526 | + function initLastGenerationType() { | |
| 527 | + let lastGenerationType = ''; | |
| 528 | + | |
| 529 | + MacrosParser.registerMacro('lastGenerationType', () => lastGenerationType); | |
| 530 | + | |
| 531 | + eventSource.on(event_types.GENERATION_STARTED, (type, _params, isDryRun) => { | |
| 532 | + if (isDryRun) return; | |
| 533 | + lastGenerationType = type || 'normal'; | |
| 534 | + }); | |
| 535 | + | |
| 536 | + eventSource.on(event_types.CHAT_CHANGED, () => { | |
| 537 | + lastGenerationType = ''; | |
| 538 | + }); | |
| 539 | + } | |
| 540 | + | |
| 541 | + initLastGenerationType(); | |
| 542 | +} | |
| @@ -246,6 +246,7 @@ let power_user = { | ||
| 246 | 246 | }, |
| 247 | 247 | |
| 248 | 248 | context_derived: false, |
| 249 | + context_size_derived: false, | |
| 249 | 250 | |
| 250 | 251 | sysprompt: { |
| 251 | 252 | enabled: true, |
| @@ -1482,6 +1483,7 @@ async function loadPowerUserSettings(settings, data) { | ||
| 1482 | 1483 | $('#example_messages_behavior').val(getExampleMessagesBehavior()); |
| 1483 | 1484 | $(`#example_messages_behavior option[value="${getExampleMessagesBehavior()}"]`).prop('selected', true); |
| 1484 | 1485 | $('#context_derived').parent().find('i').toggleClass('toggleEnabled', !!power_user.context_derived); |
| 1486 | + $('#context_size_derived').prop('checked', !!power_user.context_size_derived); | |
| 1485 | 1487 | |
| 1486 | 1488 | $('#console_log_prompts').prop('checked', power_user.console_log_prompts); |
| 1487 | 1489 | $('#request_token_probabilities').prop('checked', power_user.request_token_probabilities); |
| @@ -3079,6 +3081,16 @@ $(document).ready(() => { | ||
| 3079 | 3081 | $('#context_derived').parent().find('i').toggleClass('toggleEnabled', !!power_user.context_derived); |
| 3080 | 3082 | }); |
| 3081 | 3083 | |
| 3084 | + $('#context_size_derived').on('input', function () { | |
| 3085 | + const value = !!$(this).prop('checked'); | |
| 3086 | + power_user.context_size_derived = value; | |
| 3087 | + saveSettingsDebounced(); | |
| 3088 | + }); | |
| 3089 | + | |
| 3090 | + $('#context_size_derived').on('change', function () { | |
| 3091 | + $('#context_size_derived').prop('checked', !!power_user.context_size_derived); | |
| 3092 | + }); | |
| 3093 | + | |
| 3082 | 3094 | $('#always-force-name2-checkbox').change(function () { |
| 3083 | 3095 | power_user.always_force_name2 = !!$(this).prop('checked'); |
| 3084 | 3096 | saveSettingsDebounced(); |
| @@ -8,6 +8,7 @@ | ||
| 8 | 8 | <li><tt>{{noop}}</tt> – <span data-i18n="help_macros_4">no operation, just an empty string.</span></li> |
| 9 | 9 | <li><tt>{{original}}</tt> – <span data-i18n="help_macros_5">global prompts defined in API settings. Only valid in Advanced Definitions prompt overrides.</span></li> |
| 10 | 10 | <li><tt>{{input}}</tt> – <span data-i18n="help_macros_6">the user input</span></li> |
| 11 | + <li><tt>{{lastGenerationType}}</tt> - <span>the type of the last queued generation request. Empty if no generations were performed yet or the active chat was switched. Possible values: "normal", "impersonate", "regenerate", "quiet", "swipe", "continue".</span></li> | |
| 11 | 12 | <li><tt>{{charPrompt}}</tt> – <span data-i18n="help_macros_7">the Character's Main Prompt override</span></li> |
| 12 | 13 | <li><tt>{{charInstruction}}</tt> – <span data-i18n="help_macros_8">the Character's Post-History Instructions override</span></li> |
| 13 | 14 | <li><tt>{{description}}</tt> – <span data-i18n="help_macros_9">the Character's Description</span></li> |
| @@ -152,7 +152,7 @@ router.post('/status', jsonParser, async function (request, response) { | ||
| 152 | 152 | |
| 153 | 153 | if (!modelsReply.ok) { |
| 154 | 154 | console.log('Models endpoint is offline.'); |
| 155 | 155 | return response.statussendStatus(400); |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | /** @type {any} */ |
| @@ -173,7 +173,7 @@ router.post('/status', jsonParser, async function (request, response) { | ||
| 173 | 173 | |
| 174 | 174 | if (!Array.isArray(data.data)) { |
| 175 | 175 | console.log('Models response is not an array.'); |
| 176 | 176 | return response.statussendStatus(400); |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | const modelIds = data.data.map(x => x.id); |
| @@ -224,7 +224,7 @@ router.post('/status', jsonParser, async function (request, response) { | ||
| 224 | 224 | return response.send({ result, data: data.data }); |
| 225 | 225 | } catch (error) { |
| 226 | 226 | console.error(error); |
| 227 | 227 | return response.statussendStatus(500); |
| 228 | 228 | } |
| 229 | 229 | }); |
| 230 | 230 | |
| @@ -244,7 +244,7 @@ router.post('/props', jsonParser, async function (request, response) { | ||
| 244 | 244 | const propsReply = await fetch(propsUrl, args); |
| 245 | 245 | |
| 246 | 246 | if (!propsReply.ok) { |
| 247 | 247 | return response.statussendStatus(400); |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | /** @type {any} */ |
| @@ -258,7 +258,7 @@ router.post('/props', jsonParser, async function (request, response) { | ||
| 258 | 258 | return response.send(props); |
| 259 | 259 | } catch (error) { |
| 260 | 260 | console.error(error); |
| 261 | 261 | return response.statussendStatus(500); |
| 262 | 262 | } |
| 263 | 263 | }); |
| 264 | 264 | |
| @@ -450,7 +450,7 @@ ollama.post('/download', jsonParser, async function (request, response) { | ||
| 450 | 450 | return response.send({ ok: true }); |
| 451 | 451 | } catch (error) { |
| 452 | 452 | console.error(error); |
| 453 | 453 | return response.statussendStatus(500); |
| 454 | 454 | } |
| 455 | 455 | }); |
| 456 | 456 | |
| @@ -493,7 +493,7 @@ ollama.post('/caption-image', jsonParser, async function (request, response) { | ||
| 493 | 493 | return response.send({ caption }); |
| 494 | 494 | } catch (error) { |
| 495 | 495 | console.error(error); |
| 496 | 496 | return response.statussendStatus(500); |
| 497 | 497 | } |
| 498 | 498 | }); |
| 499 | 499 | |
| @@ -540,7 +540,7 @@ llamacpp.post('/caption-image', jsonParser, async function (request, response) { | ||
| 540 | 540 | |
| 541 | 541 | } catch (error) { |
| 542 | 542 | console.error(error); |
| 543 | 543 | return response.statussendStatus(500); |
| 544 | 544 | } |
| 545 | 545 | }); |
| 546 | 546 | |
| @@ -569,7 +569,7 @@ llamacpp.post('/props', jsonParser, async function (request, response) { | ||
| 569 | 569 | |
| 570 | 570 | } catch (error) { |
| 571 | 571 | console.error(error); |
| 572 | 572 | return response.statussendStatus(500); |
| 573 | 573 | } |
| 574 | 574 | }); |
| 575 | 575 | |
| @@ -619,7 +619,7 @@ llamacpp.post('/slots', jsonParser, async function (request, response) { | ||
| 619 | 619 | |
| 620 | 620 | } catch (error) { |
| 621 | 621 | console.error(error); |
| 622 | 622 | return response.statussendStatus(500); |
| 623 | 623 | } |
| 624 | 624 | }); |
| 625 | 625 | |
| @@ -665,7 +665,7 @@ tabby.post('/download', jsonParser, async function (request, response) { | ||
| 665 | 665 | return response.send({ ok: true }); |
| 666 | 666 | } catch (error) { |
| 667 | 667 | console.error(error); |
| 668 | 668 | return response.statussendStatus(500); |
| 669 | 669 | } |
| 670 | 670 | }); |
| 671 | 671 | |
| @@ -2214,9 +2214,9 @@ | ||
| 2214 | 2214 | } |
| 2215 | 2215 | }, |
| 2216 | 2216 | "node_modules/cross-spawn": { |
| 2217 | 2217 | "version": "7.0.36", |
| 2218 | 2218 | "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.36.tgz", |
| 2219 | 2219 | "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6wuV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", |
| 2220 | 2220 | "license": "MIT", |
| 2221 | 2221 | "dependencies": { |
| 2222 | 2222 | "path-key": "^3.1.0", |