Merge pull request #3986 from 50h100a/pr_xtcdry Update parameters for Mancer: +XTC, +DRY, -Mirostat

9305c2978028e100bd4273613f2dd39df8c635fc

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

Signed
2 files changed, +14 -3Showing whitespace changes
public/index.html+3 -3
@@ -1406,7 +1406,7 @@
14061406 </div>
14071407 </div>
14081408
14091409 <div data-tg-type="koboldcpp, aphrodite, mancer, tabby, ooba, llamacpp" id="xtc_block" class="wide100p">
14101410 <h4 class="wide100p textAlignCenter">
14111411 <label data-i18n="Exclude Top Choices (XTC)">Exclude Top Choices (XTC)</label>
14121412 <a href="https://github.com/oobabooga/text-generation-webui/pull/6335" target="_blank">
@@ -1427,7 +1427,7 @@
14271427 </div>
14281428 </div>
14291429
14301430 <div data-tg-type="aphrodite, mancer, ooba, koboldcpp, tabby, llamacpp, dreamgen" id="dryBlock" class="wide100p">
14311431 <h4 class="wide100p textAlignCenter" title="DRY penalizes tokens that would extend the end of the input into a sequence that has previously occurred in the input. Set multiplier to 0 to disable." data-i18n="[title]DRY_Repetition_Penalty_desc">
14321432 <label data-i18n="DRY Repetition Penalty">DRY Repetition Penalty</label>
14331433 <a href="https://github.com/oobabooga/text-generation-webui/pull/5677" target="_blank">
@@ -1493,7 +1493,7 @@
14931493 </div>
14941494 </div>
14951495 </div>
14961496 <div data-tg-type="ooba,infermaticai,koboldcpp,llamacpp,mancer,ollama,tabby" id="mirostat_block_ooba" class="wide100p">
14971497 <h4 class="wide100p textAlignCenter">
14981498 <label data-i18n="Mirostat (mode=1 is only for llama.cpp)">Mirostat</label>
14991499 <div class=" fa-solid fa-circle-info opacity50p " data-i18n="[title]Mirostat_desc" title="Mirostat is a thermostat for output perplexity.&#13;Mirostat matches the output perplexity to that of the input, thus avoiding the repetition trap&#13;(where, as the autoregressive inference produces text, the perplexity of the output tends toward zero)&#13;and the confusion trap (where the perplexity diverges).&#13;For details, see the paper Mirostat: A Neural Text Decoding Algorithm that Directly Controls Perplexity by Basu et al. (2020).&#13;Mode chooses the Mirostat version. 0=disable, 1=Mirostat 1.0 (llama.cpp only), 2=Mirostat 2.0."></div>
public/scripts/textgen-settings.js+11 -0
@@ -1439,6 +1439,17 @@ export async function getTextGenGenerationData(finalPrompt, maxTokens, isImperso
14391439 params.dynatemp_max = params.dynatemp_high;
14401440 delete params.dynatemp_low;
14411441 delete params.dynatemp_high;
1442+ const sequenceBreakers = (() => {
1443+ try {
1444+ return JSON.parse(params.dry_sequence_breakers);
1445+ } catch {
1446+ if (typeof params.dry_sequence_breakers === 'string') {
1447+ return params.dry_sequence_breakers.split(',');
1448+ }
1449+ return undefined;
1450+ }
1451+ })();
1452+ params.dry_sequence_breakers = sequenceBreakers;
14421453 }
14431454
14441455 if (settings.type === TABBY) {