Merge remote-tracking branch 'alpin/staging' into sampler_order

86b42477673a2f27019562e0308092586d5ced29

AlpinDale <alpindale@gmail.com>

11 files changed, +149 -61Showing whitespace changes
package-lock.json+2 -2
@@ -1,12 +1,12 @@
1{1{
2 "name": "sillytavern",2 "name": "sillytavern",
3 "version": "1.12.7",3 "version": "1.12.8",
4 "lockfileVersion": 3,4 "lockfileVersion": 3,
5 "requires": true,5 "requires": true,
6 "packages": {6 "packages": {
7 "": {7 "": {
8 "name": "sillytavern",8 "name": "sillytavern",
9 "version": "1.12.7",9 "version": "1.12.8",
10 "hasInstallScript": true,10 "hasInstallScript": true,
11 "license": "AGPL-3.0",11 "license": "AGPL-3.0",
12 "dependencies": {12 "dependencies": {
package.json+1 -1
@@ -84,7 +84,7 @@
84 "type": "git",84 "type": "git",
85 "url": "https://github.com/SillyTavern/SillyTavern.git"85 "url": "https://github.com/SillyTavern/SillyTavern.git"
86 },86 },
87 "version": "1.12.7",87 "version": "1.12.8",
88 "scripts": {88 "scripts": {
89 "start": "node server.js",89 "start": "node server.js",
90 "start:deno": "deno run --allow-run --allow-net --allow-read --allow-write --allow-sys --allow-env server.js",90 "start:deno": "deno run --allow-run --allow-net --allow-read --allow-write --allow-sys --allow-env server.js",
public/index.html+78 -39
@@ -820,8 +820,8 @@
820 </div>820 </div>
821 </div>821 </div>
822 <div class="range-block m-t-1">822 <div class="range-block m-t-1">
823 <div class="range-block-title openai_restorable" data-i18n="World Info Format Template">823 <div class="range-block-title openai_restorable">
824 <span>World Info format template</span>824 <span data-i18n="World Info Format Template">World Info format template</span>
825 <div id="wi_format_restore" data-i18n="[title]Restore default format" title="Restore default format" class="right_menu_button">825 <div id="wi_format_restore" data-i18n="[title]Restore default format" title="Restore default format" class="right_menu_button">
826 <div class="fa-solid fa-clock-rotate-left"></div>826 <div class="fa-solid fa-clock-rotate-left"></div>
827 </div>827 </div>
@@ -1524,15 +1524,15 @@
1524 <div class="">1524 <div class="">
1525 <label class="checkbox_label" for="early_stopping_textgenerationwebui">1525 <label class="checkbox_label" for="early_stopping_textgenerationwebui">
1526 <input type="checkbox" id="early_stopping_textgenerationwebui" />1526 <input type="checkbox" id="early_stopping_textgenerationwebui" />
1527 <small data-i18n="Early Stopping">Early Stopping1527 <small data-i18n="Early Stopping">Early Stopping</small>
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>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 </label>1529 </label>
1531 </div>1530 </div>
1532 </div>1531 </div>
1533 </div>1532 </div>
1534 <div data-tg-type="ooba" id="contrastiveSearchBlock" name="contrastiveSearchBlock" class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0">1533 <div data-tg-type="ooba" id="contrastiveSearchBlock" name="contrastiveSearchBlock" class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0">
1535 <h4 class="textAlignCenter" data-i18n="Contrastive search">Contrastive Search1534 <h4 class="textAlignCenter">
1535 <span data-i18n="Contrastive search">Contrastive Search</span>
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>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 </h4>1537 </h4>
1538 <div class="alignitemscenter flex-container flexFlowColumn wide100p gap0">1538 <div class="alignitemscenter flex-container flexFlowColumn wide100p gap0">
@@ -1566,9 +1566,8 @@
1566 </label>1566 </label>
1567 <label data-tg-type="vllm, aphrodite, infermaticai" class="checkbox_label" for="ignore_eos_token_textgenerationwebui">1567 <label data-tg-type="vllm, aphrodite, infermaticai" class="checkbox_label" for="ignore_eos_token_textgenerationwebui">
1568 <input type="checkbox" id="ignore_eos_token_textgenerationwebui" />1568 <input type="checkbox" id="ignore_eos_token_textgenerationwebui" />
1569 <small data-i18n="Ignore EOS Token">Ignore EOS Token1569 <small data-i18n="Ignore EOS Token">Ignore EOS Token</small>
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>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 </label>1571 </label>
1573 <label class="checkbox_label flexGrow flexShrink" for="skip_special_tokens_textgenerationwebui">1572 <label class="checkbox_label flexGrow flexShrink" for="skip_special_tokens_textgenerationwebui">
1574 <input type="checkbox" id="skip_special_tokens_textgenerationwebui" />1573 <input type="checkbox" id="skip_special_tokens_textgenerationwebui" />
@@ -1629,7 +1628,8 @@
1629 </div>1628 </div>
1630 <div id="cfg_block_ooba" data-tg-type="ooba, tabby" class="wide100p">1629 <div id="cfg_block_ooba" data-tg-type="ooba, tabby" class="wide100p">
1631 <hr class="width100p">1630 <hr class="width100p">
1632 <h4 data-i18n="CFG" class="textAlignCenter">CFG1631 <h4 class="textAlignCenter">
1632 <span data-i18n="CFG">CFG</span>
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>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 </h4>1634 </h4>
1635 <div class="alignitemscenter flex-container flexFlowColumn flexShrink gap0">1635 <div class="alignitemscenter flex-container flexFlowColumn flexShrink gap0">
@@ -2032,8 +2032,10 @@
2032 <div id="logit_bias_openai" class="range-block-title openai_restorable" data-i18n="Logit Bias">2032 <div id="logit_bias_openai" class="range-block-title openai_restorable" data-i18n="Logit Bias">
2033 Logit Bias2033 Logit Bias
2034 </div>2034 </div>
2035 <div class="toggle-description justifyLeft" data-i18n="Helps to ban or reenforce the usage of certain words">2035 <div class="toggle-description justifyLeft">
2036 Helps to ban or reinforce the usage of certain tokens. Confirm token parsing with <a target="_blank" href="https://platform.openai.com/tokenizer/">Tokenizer</a>.2036 <span data-i18n="Helps to ban or reenforce the usage of certain words">Helps to ban or reinforce the usage of certain tokens.</span>
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 </div>2039 </div>
2038 <div class="openai_logit_bias_preset_form">2040 <div class="openai_logit_bias_preset_form">
2039 <select id="openai_logit_bias_preset">2041 <select id="openai_logit_bias_preset">
@@ -2334,8 +2336,8 @@
2334 <div data-tg-type="mancer" class="flex-container flexFlowColumn">2336 <div data-tg-type="mancer" class="flex-container flexFlowColumn">
2335 <div class="flex-container flexFlowColumn">2337 <div class="flex-container flexFlowColumn">
2336 </div>2338 </div>
2337 <h4 data-i18n="Mancer API key">2339 <h4>
2338 Mancer API key2340 <span data-i18n="Mancer API key">Mancer API key</span>
2339 <a href="https://mancer.tech/" class="notes-link" target="_blank">2341 <a href="https://mancer.tech/" class="notes-link" target="_blank">
2340 <span class="fa-solid fa-circle-question note-link-span"></span>2342 <span class="fa-solid fa-circle-question note-link-span"></span>
2341 </a>2343 </a>
@@ -2631,15 +2633,21 @@
2631 <input id="koboldcpp_api_url_text" class="text_pole wide100p" value="" autocomplete="off" data-server-history="koboldcpp">2633 <input id="koboldcpp_api_url_text" class="text_pole wide100p" value="" autocomplete="off" data-server-history="koboldcpp">
2632 </div>2634 </div>
2633 </div>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 <div class="flex-container">2646 <div class="flex-container">
2635 <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>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 <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>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 <div class="api_loading menu_button menu_button_icon" data-i18n="Cancel">Cancel</div>2649 <div class="api_loading menu_button menu_button_icon" data-i18n="Cancel">Cancel</div>
2638 </div>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 </form>2651 </form>
2644 <div class="online_status">2652 <div class="online_status">
2645 <div class="online_status_indicator"></div>2653 <div class="online_status_indicator"></div>
@@ -2682,8 +2690,9 @@
2682 </div>2690 </div>
2683 <div class="toggle-description justifyLeft">2691 <div class="toggle-description justifyLeft">
2684 <span data-i18n="Saved addresses and passwords.">2692 <span data-i18n="Saved addresses and passwords.">
2685 Saved addresses and passwords.<br>2693 Saved addresses and passwords.
2686 </span>2694 </span>
2695 <br>
2687 </div>2696 </div>
2688 <div class="openai_logit_bias_preset_form">2697 <div class="openai_logit_bias_preset_form">
2689 <select id="openai_proxy_preset">2698 <select id="openai_proxy_preset">
@@ -2696,8 +2705,9 @@
2696 </div>2705 </div>
2697 <div class="toggle-description justifyLeft">2706 <div class="toggle-description justifyLeft">
2698 <span data-i18n="This will show up as your saved preset.">2707 <span data-i18n="This will show up as your saved preset.">
2699 This will show up as your saved preset.<br>2708 This will show up as your saved preset.
2700 </span>2709 </span>
2710 <br>
2701 </div>2711 </div>
2702 <div class="wide100p">2712 <div class="wide100p">
2703 <input id="openai_reverse_proxy_name" type="text" class="text_pole" placeholder="..." />2713 <input id="openai_reverse_proxy_name" type="text" class="text_pole" placeholder="..." />
@@ -2707,8 +2717,9 @@
2707 </div>2717 </div>
2708 <div class="toggle-description justifyLeft wide100p">2718 <div class="toggle-description justifyLeft wide100p">
2709 <span data-i18n="Alternative server URL (leave empty to use the default value).">2719 <span data-i18n="Alternative server URL (leave empty to use the default value).">
2710 Alternative server URL (leave empty to use the default value).<br>2720 Alternative server URL (leave empty to use the default value).
2711 </span>2721 </span>
2722 <br>
2712 </div>2723 </div>
2713 <div class="wide100p">2724 <div class="wide100p">
2714 <input id="openai_reverse_proxy" type="text" class="text_pole" placeholder="https://api.openai.com/v1" />2725 <input id="openai_reverse_proxy" type="text" class="text_pole" placeholder="https://api.openai.com/v1" />
@@ -2721,8 +2732,9 @@
2721 </div>2732 </div>
2722 <div class="toggle-description justifyLeft">2733 <div class="toggle-description justifyLeft">
2723 <span data-i18n="Will be used as a password for the proxy instead of API key.">2734 <span data-i18n="Will be used as a password for the proxy instead of API key.">
2724 Will be used as a password for the proxy instead of API key.<br>2735 Will be used as a password for the proxy instead of API key.
2725 </span>2736 </span>
2737 <br>
2726 </div>2738 </div>
2727 <div class="flex-container width100p">2739 <div class="flex-container width100p">
2728 <input id="openai_proxy_password" type="password" class="text_pole flex1" placeholder="" form="openai_form" autocomplete="off" />2740 <input id="openai_proxy_password" type="password" class="text_pole flex1" placeholder="" form="openai_form" autocomplete="off" />
@@ -3810,7 +3822,11 @@
3810 <div id="wiTopBlock" class="flex-container">3822 <div id="wiTopBlock" class="flex-container">
3811 <div id="WIMultiSelector" class="flex1 flex alignSelfStart range-block">3823 <div id="WIMultiSelector" class="flex1 flex alignSelfStart range-block">
3812 <div class="range-block-title justifyLeft">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 </div>3830 </div>
3815 <div class="range-block-range">3831 <div class="range-block-range">
3816 <select id="world_info" class="select2_multi_sameline" multiple>3832 <select id="world_info" class="select2_multi_sameline" multiple>
@@ -4135,7 +4151,10 @@
41354151
4136 <div class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0">4152 <div class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0">
4137 <small>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 <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>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 </small>4159 </small>
4141 <input class="neo-range-slider" type="range" id="chat_width_slider" name="chat_width_slider" min="25" max="100" step="1">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 <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.">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 <small data-i18n="Reload Chat">Reload Chat</small>4327 <small data-i18n="Reload Chat">Reload Chat</small>
4309 </div>4328 </div>
4310 <div id="debug_menu" class="menu_button whitespacenowrap" data-i18n="Debug Menu">4329 <div id="debug_menu" class="menu_button whitespacenowrap">
4311 <small data-i18n="Debug Menu">Debug Menu</small>4330 <small data-i18n="Debug Menu">Debug Menu</small>
4312 </div>4331 </div>
4313 </div>4332 </div>
@@ -4426,8 +4445,10 @@
4426 </div>4445 </div>
4427 </div>4446 </div>
4428 <div id="examples-behavior-block">4447 <div id="examples-behavior-block">
4429 <label data-i18n="Example Messages Behavior">4448 <label>
4430 <small>Example Messages Behavior:</small>4449 <small data-i18n="Example Messages Behavior">
4450 Example Messages Behavior:
4451 </small>
4431 </label>4452 </label>
4432 <select id="example_messages_behavior">4453 <select id="example_messages_behavior">
4433 <option value="normal" data-i18n="Gradual push-out">Gradual push-out</option>4454 <option value="normal" data-i18n="Gradual push-out">Gradual push-out</option>
@@ -4591,7 +4612,9 @@
4591 </label>4612 </label>
4592 <div class="flex-container">4613 <div class="flex-container">
4593 <div class="flex1" title="Determines how entries are found for autocomplete." data-i18n="[title]Determines how entries are found for autocomplete.">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 <select id="stscript_matching">4618 <select id="stscript_matching">
4596 <option data-i18n="Starts with" value="strict">Starts with</option>4619 <option data-i18n="Starts with" value="strict">Starts with</option>
4597 <option data-i18n="Includes" value="includes">Includes</option>4620 <option data-i18n="Includes" value="includes">Includes</option>
@@ -4599,7 +4622,9 @@
4599 </select>4622 </select>
4600 </div>4623 </div>
4601 <div class="flex1" title="Sets the style of the autocomplete." data-i18n="[title]Sets the style of the autocomplete.">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 <div class="flex-container flexFlowRow alignItemsBaseline">4628 <div class="flex-container flexFlowRow alignItemsBaseline">
4604 <select id="stscript_autocomplete_style">4629 <select id="stscript_autocomplete_style">
4605 <option data-i18n="Follow Theme" value="theme">Follow Theme</option>4630 <option data-i18n="Follow Theme" value="theme">Follow Theme</option>
@@ -4611,8 +4636,8 @@
4611 </div>4636 </div>
4612 </div>4637 </div>
4613 <div title="Determines which keys select an item from the AutoComplete suggestions">4638 <div title="Determines which keys select an item from the AutoComplete suggestions">
4614 <label data-i18n="Keyboard">4639 <label>
4615 <small>Keyboard:</small>4640 <small data-i18n="Keyboard">Keyboard:</small>
4616 </label>4641 </label>
4617 <select id="stscript_autocomplete_select">4642 <select id="stscript_autocomplete_select">
4618 <option value="3" data-i18n="Select with Tab or Enter">Select with Tab or Enter</option>4643 <option value="3" data-i18n="Select with Tab or Enter">Select with Tab or Enter</option>
@@ -4626,7 +4651,9 @@
4626 <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">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 </div>4652 </div>
4628 <div title="Sets the width of the autocomplete." data-i18n="[title]Sets the width of the autocomplete.">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 <div class="doubleRangeContainer">4657 <div class="doubleRangeContainer">
4631 <div class="doubleRangeInputContainer">4658 <div class="doubleRangeInputContainer">
4632 <input type="range" id="stscript_autocomplete_width_left" min="0" max="2" step="1">4659 <input type="range" id="stscript_autocomplete_width_left" min="0" max="2" step="1">
@@ -4654,14 +4681,18 @@
4654 <label><small data-i18n="Parser Flags">Parser Flags</small></label>4681 <label><small data-i18n="Parser Flags">Parser Flags</small></label>
4655 <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.">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 <input id="stscript_parser_flag_strict_escaping" type="checkbox" />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 <a href="https://docs.sillytavern.app/usage/st-script/#strict-escaping" target="_blank" class="notes-link">4687 <a href="https://docs.sillytavern.app/usage/st-script/#strict-escaping" target="_blank" class="notes-link">
4659 <span class="fa-solid fa-circle-question note-link-span"></span>4688 <span class="fa-solid fa-circle-question note-link-span"></span>
4660 </a>4689 </a>
4661 </label>4690 </label>
4662 <label class="checkbox_label" title="Prevents {{getvar::}} {{getglobalvar::}} macros from having literal macro-like values auto-evaluated.&NewLine;e.g. &quot;{{newline}}&quot; remains as literal string &quot;{{newline}}&quot;&NewLine;&NewLine;(This is done by internally replacing {{getvar::}} {{getglobalvar::}} macros with scoped variables.)" data-i18n="[title]stscript_parser_flag_replace_getvar_label">4691 <label class="checkbox_label" title="Prevents {{getvar::}} {{getglobalvar::}} macros from having literal macro-like values auto-evaluated.&NewLine;e.g. &quot;{{newline}}&quot; remains as literal string &quot;{{newline}}&quot;&NewLine;&NewLine;(This is done by internally replacing {{getvar::}} {{getglobalvar::}} macros with scoped variables.)" data-i18n="[title]stscript_parser_flag_replace_getvar_label">
4663 <input id="stscript_parser_flag_replace_getvar" type="checkbox" />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 <a href="https://docs.sillytavern.app/usage/st-script/#replace-variable-macros" target="_blank" class="notes-link">4696 <a href="https://docs.sillytavern.app/usage/st-script/#replace-variable-macros" target="_blank" class="notes-link">
4666 <span class="fa-solid fa-circle-question note-link-span"></span>4697 <span class="fa-solid fa-circle-question note-link-span"></span>
4667 </a>4698 </a>
@@ -4792,10 +4823,12 @@
4792 <div class="flex-container wide100p alignitemscenter spaceBetween flexNoGap">4823 <div class="flex-container wide100p alignitemscenter spaceBetween flexNoGap">
4793 <div class="flex-container alignItemsBaseline wide100p">4824 <div class="flex-container alignItemsBaseline wide100p">
4794 <div class="flex1 flex-container alignItemsBaseline">4825 <div class="flex1 flex-container alignItemsBaseline">
4795 <h3 class="margin0" data-i18n="Persona Management">Persona Management</h3>4826 <h3 class="margin0" >
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>
4828 <a href="https://docs.sillytavern.app/usage/core-concepts/personas/" target="_blank">
4797 <span class="fa-solid fa-circle-question note-link-span"></span>4829 <span class="fa-solid fa-circle-question note-link-span"></span>
4798 </a>4830 </a>
4831 </h3>
4799 </div>4832 </div>
4800 <div class="flex-container">4833 <div class="flex-container">
4801 <div class="menu_button menu_button_icon user_stats_button" data-i18n="[title]Click for stats!" title="Click for stats!">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 <span data-i18n="Examples of dialogue" class="mdhotkey_location">Examples of dialogue</span>5549 <span data-i18n="Examples of dialogue" class="mdhotkey_location">Examples of dialogue</span>
5517 <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>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 </h4>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 </div>5558 </div>
5521 <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 &lt;START&gt; on a new line.)" form="form_create" rows="6"></textarea>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 &lt;START&gt; on a new line.)" form="form_create" rows="6"></textarea>
5522 <div class="extension_token_counter">5560 <div class="extension_token_counter">
@@ -5592,7 +5630,8 @@
5592 <div class="character_world range-block flexFlowColumn flex-container">5630 <div class="character_world range-block flexFlowColumn flex-container">
5593 <div class="range-block-title">5631 <div class="range-block-title">
5594 <h3>5632 <h3>
5595 <span data-i18n="Select a World Info file for"> Select a World Info file for <span class="character_name"></span></span>:5633 <span data-i18n="Select a World Info file for">Select a World Info file for</span>
5634 <span class="character_name"></span>:
5596 </h3>5635 </h3>
5597 </div>5636 </div>
5598 <h4 data-i18n="Primary Lorebook">Primary Lorebook</h4>5637 <h4 data-i18n="Primary Lorebook">Primary Lorebook</h4>
@@ -5893,7 +5932,7 @@
5893 </div>5932 </div>
5894 <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.">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 <div class="flex-container justifySpaceBetween marginBot5">5934 <div class="flex-container justifySpaceBetween marginBot5">
5896 <small class="flex-container alignItemsBaseline" for="sticky" data-i18n="Sticky">5935 <small class="flex-container alignItemsBaseline" for="sticky">
5897 <span data-i18n="Sticky">5936 <span data-i18n="Sticky">
5898 Sticky5937 Sticky
5899 </span>5938 </span>
@@ -5906,7 +5945,7 @@
5906 </div>5945 </div>
5907 <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.">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 <div class="flex-container justifySpaceBetween marginBot5">5947 <div class="flex-container justifySpaceBetween marginBot5">
5909 <small class="flex-container alignItemsBaseline" for="cooldown" data-i18n="Cooldown">5948 <small class="flex-container alignItemsBaseline" for="cooldown">
5910 <span data-i18n="Cooldown">5949 <span data-i18n="Cooldown">
5911 Cooldown5950 Cooldown
5912 </span>5951 </span>
@@ -5919,7 +5958,7 @@
5919 </div>5958 </div>
5920 <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.">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 <div class="flex-container justifySpaceBetween marginBot5">5960 <div class="flex-container justifySpaceBetween marginBot5">
5922 <small class="flex-container alignItemsBaseline" for="delay" data-i18n="Delay">5961 <small class="flex-container alignItemsBaseline" for="delay">
5923 <span data-i18n="Delay">5962 <span data-i18n="Delay">
5924 Delay5963 Delay
5925 </span>5964 </span>
public/script.js+19 -2
@@ -242,7 +242,7 @@ import { BulkEditOverlay, CharacterContextMenu } from './scripts/BulkEditOverlay
242import { loadFeatherlessModels, loadMancerModels, loadOllamaModels, loadTogetherAIModels, loadInfermaticAIModels, loadOpenRouterModels, loadVllmModels, loadAphroditeModels, loadDreamGenModels, initTextGenModels, loadTabbyModels } from './scripts/textgen-models.js';242import { loadFeatherlessModels, loadMancerModels, loadOllamaModels, loadTogetherAIModels, loadInfermaticAIModels, loadOpenRouterModels, loadVllmModels, loadAphroditeModels, loadDreamGenModels, initTextGenModels, loadTabbyModels } from './scripts/textgen-models.js';
243import { appendFileContent, hasPendingFileAttachment, populateFileAttachment, decodeStyleTags, encodeStyleTags, isExternalMediaAllowed, getCurrentEntityId, preserveNeutralChat, restoreNeutralChat } from './scripts/chats.js';243import { appendFileContent, hasPendingFileAttachment, populateFileAttachment, decodeStyleTags, encodeStyleTags, isExternalMediaAllowed, getCurrentEntityId, preserveNeutralChat, restoreNeutralChat } from './scripts/chats.js';
244import { initPresetManager } from './scripts/preset-manager.js';244import { initPresetManager } from './scripts/preset-manager.js';
245import { MacrosParser, evaluateMacros, getLastMessageId } from './scripts/macros.js';245import { MacrosParser, evaluateMacros, getLastMessageId, initMacros } from './scripts/macros.js';
246import { currentUser, setUserControls } from './scripts/user.js';246import { currentUser, setUserControls } from './scripts/user.js';
247import { POPUP_RESULT, POPUP_TYPE, Popup, callGenericPopup, fixToastrForDialogs } from './scripts/popup.js';247import { POPUP_RESULT, POPUP_TYPE, Popup, callGenericPopup, fixToastrForDialogs } from './scripts/popup.js';
248import { renderTemplate, renderTemplateAsync } from './scripts/templates.js';248import { renderTemplate, renderTemplateAsync } from './scripts/templates.js';
@@ -957,6 +957,7 @@ async function firstLoadInit() {
957 initDynamicStyles();957 initDynamicStyles();
958 initTags();958 initTags();
959 initBookmarks();959 initBookmarks();
960 initMacros();
960 await getUserAvatars(true, user_avatar);961 await getUserAvatars(true, user_avatar);
961 await getCharacters();962 await getCharacters();
962 await getBackgrounds();963 await getBackgrounds();
@@ -1238,8 +1239,9 @@ async function getStatusTextgen() {
12381239
1239 const wantsInstructDerivation = (power_user.instruct.enabled && power_user.instruct.derived);1240 const wantsInstructDerivation = (power_user.instruct.enabled && power_user.instruct.derived);
1240 const wantsContextDerivation = power_user.context_derived;1241 const wantsContextDerivation = power_user.context_derived;
1242 const wantsContextSize = power_user.context_size_derived;
1241 const supportsChatTemplate = [textgen_types.KOBOLDCPP, textgen_types.LLAMACPP].includes(textgen_settings.type);1243 const supportsChatTemplate = [textgen_types.KOBOLDCPP, textgen_types.LLAMACPP].includes(textgen_settings.type);
1242 if (supportsChatTemplate && (wantsInstructDerivation || wantsContextDerivation)) {1244 if (supportsChatTemplate && (wantsInstructDerivation || wantsContextDerivation || wantsContextSize)) {
1243 const response = await fetch('/api/backends/text-completions/props', {1245 const response = await fetch('/api/backends/text-completions/props', {
1244 method: 'POST',1246 method: 'POST',
1245 headers: getRequestHeaders(),1247 headers: getRequestHeaders(),
@@ -1253,6 +1255,17 @@ async function getStatusTextgen() {
1253 const data = await response.json();1255 const data = await response.json();
1254 if (data) {1256 if (data) {
1255 const { chat_template, chat_template_hash } = data;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 console.log(`We have chat template ${chat_template.split('\n')[0]}...`);1269 console.log(`We have chat template ${chat_template.split('\n')[0]}...`);
1257 const templates = await deriveTemplatesFromChatTemplate(chat_template, chat_template_hash);1270 const templates = await deriveTemplatesFromChatTemplate(chat_template, chat_template_hash);
1258 if (templates) {1271 if (templates) {
@@ -6822,6 +6835,10 @@ export async function saveSettings(type) {
6822 });6835 });
6823}6836}
68246837
6838/**
6839 * Sets the generation parameters from a preset object.
6840 * @param {{ genamt?: number, max_length?: number }} preset Preset object
6841 */
6825export function setGenerationParamsFromPreset(preset) {6842export function setGenerationParamsFromPreset(preset) {
6826 const needsUnlock = (preset.max_length ?? max_context) > MAX_CONTEXT_DEFAULT || (preset.genamt ?? amount_gen) > MAX_RESPONSE_DEFAULT;6843 const needsUnlock = (preset.max_length ?? max_context) > MAX_CONTEXT_DEFAULT || (preset.genamt ?? amount_gen) > MAX_RESPONSE_DEFAULT;
6827 $('#max_context_unlocked').prop('checked', needsUnlock).trigger('change');6844 $('#max_context_unlocked').prop('checked', needsUnlock).trigger('change');
public/scripts/extensions/expressions/settings.html+1 -1
@@ -40,7 +40,7 @@
40 <div class="expression_fallback_block m-b-1 m-t-1">40 <div class="expression_fallback_block m-b-1 m-t-1">
41 <label for="expression_fallback" data-i18n="Default / Fallback Expression">Default / Fallback Expression</label>41 <label for="expression_fallback" data-i18n="Default / Fallback Expression">Default / Fallback Expression</label>
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>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 <select id="expression_fallback" class="flex1 margin0" data-i18n="Fallback Expression" placeholder="Fallback Expression"></select>43 <select id="expression_fallback" class="flex1 margin0"></select>
44 </div>44 </div>
45 <div class="expression_custom_block m-b-1 m-t-1">45 <div class="expression_custom_block m-b-1 m-t-1">
46 <label for="expression_custom" data-i18n="Custom Expressions">Custom Expressions</label>46 <label for="expression_custom" data-i18n="Custom Expressions">Custom Expressions</label>
public/scripts/extensions/tts/settings.html+1 -1
@@ -57,7 +57,7 @@
57 </div>57 </div>
58 <div id="playback_rate_block" class="range-block">58 <div id="playback_rate_block" class="range-block">
59 <hr>59 <hr>
60 <div class="range-block-title justifyLeft" data-i18n="Audio Playback Speed">60 <div class="range-block-title justifyLeft">
61 <small data-i18n="Audio Playback Speed">Audio Playback Speed</small>61 <small data-i18n="Audio Playback Speed">Audio Playback Speed</small>
62 </div>62 </div>
63 <div class="range-block-range-and-counter">63 <div class="range-block-range-and-counter">
public/scripts/macros.js+20 -1
@@ -1,5 +1,5 @@
1import { Handlebars, moment, seedrandom, droll } from '../lib.js';1import { Handlebars, moment, seedrandom, droll } from '../lib.js';
2import { chat, chat_metadata, main_api, getMaxContextSize, getCurrentChatId, substituteParams } from '../script.js';2import { chat, chat_metadata, main_api, getMaxContextSize, getCurrentChatId, substituteParams, eventSource, event_types } from '../script.js';
3import { timestampToMoment, isDigitsOnly, getStringHash, escapeRegex, uuidv4 } from './utils.js';3import { timestampToMoment, isDigitsOnly, getStringHash, escapeRegex, uuidv4 } from './utils.js';
4import { textgenerationwebui_banned_in_macros } from './textgen-settings.js';4import { textgenerationwebui_banned_in_macros } from './textgen-settings.js';
5import { getInstructMacros } from './instruct-mode.js';5import { getInstructMacros } from './instruct-mode.js';
@@ -521,3 +521,22 @@ export function evaluateMacros(content, env, postProcessFn) {
521521
522 return content;522 return content;
523}523}
524
525export 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}
public/scripts/power-user.js+12 -0
@@ -246,6 +246,7 @@ let power_user = {
246 },246 },
247247
248 context_derived: false,248 context_derived: false,
249 context_size_derived: false,
249250
250 sysprompt: {251 sysprompt: {
251 enabled: true,252 enabled: true,
@@ -1482,6 +1483,7 @@ async function loadPowerUserSettings(settings, data) {
1482 $('#example_messages_behavior').val(getExampleMessagesBehavior());1483 $('#example_messages_behavior').val(getExampleMessagesBehavior());
1483 $(`#example_messages_behavior option[value="${getExampleMessagesBehavior()}"]`).prop('selected', true);1484 $(`#example_messages_behavior option[value="${getExampleMessagesBehavior()}"]`).prop('selected', true);
1484 $('#context_derived').parent().find('i').toggleClass('toggleEnabled', !!power_user.context_derived);1485 $('#context_derived').parent().find('i').toggleClass('toggleEnabled', !!power_user.context_derived);
1486 $('#context_size_derived').prop('checked', !!power_user.context_size_derived);
14851487
1486 $('#console_log_prompts').prop('checked', power_user.console_log_prompts);1488 $('#console_log_prompts').prop('checked', power_user.console_log_prompts);
1487 $('#request_token_probabilities').prop('checked', power_user.request_token_probabilities);1489 $('#request_token_probabilities').prop('checked', power_user.request_token_probabilities);
@@ -3079,6 +3081,16 @@ $(document).ready(() => {
3079 $('#context_derived').parent().find('i').toggleClass('toggleEnabled', !!power_user.context_derived);3081 $('#context_derived').parent().find('i').toggleClass('toggleEnabled', !!power_user.context_derived);
3080 });3082 });
30813083
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 $('#always-force-name2-checkbox').change(function () {3094 $('#always-force-name2-checkbox').change(function () {
3083 power_user.always_force_name2 = !!$(this).prop('checked');3095 power_user.always_force_name2 = !!$(this).prop('checked');
3084 saveSettingsDebounced();3096 saveSettingsDebounced();
public/scripts/templates/macros.html+1 -0
@@ -8,6 +8,7 @@
8 <li><tt>&lcub;&lcub;noop&rcub;&rcub;</tt> – <span data-i18n="help_macros_4">no operation, just an empty string.</span></li>8 <li><tt>&lcub;&lcub;noop&rcub;&rcub;</tt> – <span data-i18n="help_macros_4">no operation, just an empty string.</span></li>
9 <li><tt>&lcub;&lcub;original&rcub;&rcub;</tt> – <span data-i18n="help_macros_5">global prompts defined in API settings. Only valid in Advanced Definitions prompt overrides.</span></li>9 <li><tt>&lcub;&lcub;original&rcub;&rcub;</tt> – <span data-i18n="help_macros_5">global prompts defined in API settings. Only valid in Advanced Definitions prompt overrides.</span></li>
10 <li><tt>&lcub;&lcub;input&rcub;&rcub;</tt> – <span data-i18n="help_macros_6">the user input</span></li>10 <li><tt>&lcub;&lcub;input&rcub;&rcub;</tt> – <span data-i18n="help_macros_6">the user input</span></li>
11 <li><tt>&lcub;&lcub;lastGenerationType&rcub;&rcub;</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 <li><tt>&lcub;&lcub;charPrompt&rcub;&rcub;</tt> – <span data-i18n="help_macros_7">the Character's Main Prompt override</span></li>12 <li><tt>&lcub;&lcub;charPrompt&rcub;&rcub;</tt> – <span data-i18n="help_macros_7">the Character's Main Prompt override</span></li>
12 <li><tt>&lcub;&lcub;charInstruction&rcub;&rcub;</tt> – <span data-i18n="help_macros_8">the Character's Post-History Instructions override</span></li>13 <li><tt>&lcub;&lcub;charInstruction&rcub;&rcub;</tt> – <span data-i18n="help_macros_8">the Character's Post-History Instructions override</span></li>
13 <li><tt>&lcub;&lcub;description&rcub;&rcub;</tt> – <span data-i18n="help_macros_9">the Character's Description</span></li>14 <li><tt>&lcub;&lcub;description&rcub;&rcub;</tt> – <span data-i18n="help_macros_9">the Character's Description</span></li>
src/endpoints/backends/text-completions.js+11 -11
@@ -152,7 +152,7 @@ router.post('/status', jsonParser, async function (request, response) {
152152
153 if (!modelsReply.ok) {153 if (!modelsReply.ok) {
154 console.log('Models endpoint is offline.');154 console.log('Models endpoint is offline.');
155 return response.status(400);155 return response.sendStatus(400);
156 }156 }
157157
158 /** @type {any} */158 /** @type {any} */
@@ -173,7 +173,7 @@ router.post('/status', jsonParser, async function (request, response) {
173173
174 if (!Array.isArray(data.data)) {174 if (!Array.isArray(data.data)) {
175 console.log('Models response is not an array.');175 console.log('Models response is not an array.');
176 return response.status(400);176 return response.sendStatus(400);
177 }177 }
178178
179 const modelIds = data.data.map(x => x.id);179 const modelIds = data.data.map(x => x.id);
@@ -224,7 +224,7 @@ router.post('/status', jsonParser, async function (request, response) {
224 return response.send({ result, data: data.data });224 return response.send({ result, data: data.data });
225 } catch (error) {225 } catch (error) {
226 console.error(error);226 console.error(error);
227 return response.status(500);227 return response.sendStatus(500);
228 }228 }
229});229});
230230
@@ -244,7 +244,7 @@ router.post('/props', jsonParser, async function (request, response) {
244 const propsReply = await fetch(propsUrl, args);244 const propsReply = await fetch(propsUrl, args);
245245
246 if (!propsReply.ok) {246 if (!propsReply.ok) {
247 return response.status(400);247 return response.sendStatus(400);
248 }248 }
249249
250 /** @type {any} */250 /** @type {any} */
@@ -258,7 +258,7 @@ router.post('/props', jsonParser, async function (request, response) {
258 return response.send(props);258 return response.send(props);
259 } catch (error) {259 } catch (error) {
260 console.error(error);260 console.error(error);
261 return response.status(500);261 return response.sendStatus(500);
262 }262 }
263});263});
264264
@@ -450,7 +450,7 @@ ollama.post('/download', jsonParser, async function (request, response) {
450 return response.send({ ok: true });450 return response.send({ ok: true });
451 } catch (error) {451 } catch (error) {
452 console.error(error);452 console.error(error);
453 return response.status(500);453 return response.sendStatus(500);
454 }454 }
455});455});
456456
@@ -493,7 +493,7 @@ ollama.post('/caption-image', jsonParser, async function (request, response) {
493 return response.send({ caption });493 return response.send({ caption });
494 } catch (error) {494 } catch (error) {
495 console.error(error);495 console.error(error);
496 return response.status(500);496 return response.sendStatus(500);
497 }497 }
498});498});
499499
@@ -540,7 +540,7 @@ llamacpp.post('/caption-image', jsonParser, async function (request, response) {
540540
541 } catch (error) {541 } catch (error) {
542 console.error(error);542 console.error(error);
543 return response.status(500);543 return response.sendStatus(500);
544 }544 }
545});545});
546546
@@ -569,7 +569,7 @@ llamacpp.post('/props', jsonParser, async function (request, response) {
569569
570 } catch (error) {570 } catch (error) {
571 console.error(error);571 console.error(error);
572 return response.status(500);572 return response.sendStatus(500);
573 }573 }
574});574});
575575
@@ -619,7 +619,7 @@ llamacpp.post('/slots', jsonParser, async function (request, response) {
619619
620 } catch (error) {620 } catch (error) {
621 console.error(error);621 console.error(error);
622 return response.status(500);622 return response.sendStatus(500);
623 }623 }
624});624});
625625
@@ -665,7 +665,7 @@ tabby.post('/download', jsonParser, async function (request, response) {
665 return response.send({ ok: true });665 return response.send({ ok: true });
666 } catch (error) {666 } catch (error) {
667 console.error(error);667 console.error(error);
668 return response.status(500);668 return response.sendStatus(500);
669 }669 }
670});670});
671671
tests/package-lock.json+3 -3
@@ -2214,9 +2214,9 @@
2214 }2214 }
2215 },2215 },
2216 "node_modules/cross-spawn": {2216 "node_modules/cross-spawn": {
2217 "version": "7.0.3",2217 "version": "7.0.6",
2218 "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",2218 "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
2219 "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",2219 "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
2220 "license": "MIT",2220 "license": "MIT",
2221 "dependencies": {2221 "dependencies": {
2222 "path-key": "^3.1.0",2222 "path-key": "^3.1.0",