This commit is contained in:
AlpinDale 2024-09-14 12:38:19 +00:00
parent efd477da04
commit 9c94348491
2 changed files with 23 additions and 14 deletions

View File

@ -215,7 +215,7 @@
<label class="checkbox_label">
<input id="max_context_unlocked" type="checkbox" />
<small><span data-i18n="unlocked">Unlocked</span>
<div id="max_context_unlocked_warning" class="fa-solid fa-circle-info opacity50p " data-i18n="[title]Only enable this if your model supports context sizes greater than 4096 tokens" title="Only enable this if your model supports context sizes greater than 4096 tokens.&#13;Increase only if you know what you're doing."></div>
<div id="max_context_unlocked_warning" class="fa-solid fa-circle-info opacity50p " data-i18n="[title]Only enable this if your model supports context sizes greater than 8192 tokens" title="Only enable this if your model supports context sizes greater than 4096 tokens.&#13;Increase only if you know what you're doing."></div>
</small>
</label>
</div>
@ -1396,28 +1396,36 @@
</div>
</div>
</div>
<div data-tg-type="ooba, vllm, aphrodite" id="beamSearchBlock" name="beamSearchBlock" class="wide100p">
<div data-tg-type="ooba, vllm" id="beamSearchBlock" name="beamSearchBlock" class="wide100p">
<h4 class="wide100p textAlignCenter">
<label>
<span data-i18n="Beam search">Beam Search</span>
<div class=" fa-solid fa-circle-info opacity50p " title="Helpful tip coming soon." data-i18n="[title]Helpful tip coming soon."></div>
<div class=" fa-solid fa-circle-info opacity50p " title="A greedy, brute-force algorithm used in LLM sampling to find the most likely sequence of words or tokens. It expands multiple candidate sequences at once, maintaining a fixed number (beam width) of top sequences at each step." data-i18n="[title]A greedy, brute-force algorithm used in LLM sampling to find the most likely sequence of words or tokens. It expands multiple candidate sequences at once, maintaining a fixed number (beam width) of top sequences at each step."></div>
</label>
</h4>
<div class="flex-container flexFlowRow alignitemscenter gap10px flexShrink">
<div class="alignitemscenter flex-container marginBot5 flexFlowColumn flexGrow flexShrink gap0">
<small data-i18n="Number of Beams"># of Beams</small>
<label>
<small data-i18n="# of Beams"># of Beams</small>
<div class="fa-solid fa-circle-info opacity50p" data-i18n="[title]The number of sequences generated at each step with Beam Search." title="The number of sequences generated at each step with Beam Search."></div>
</label>
<input class="neo-range-slider" type="range" id="num_beams_textgenerationwebui" name="volume" min="1" max="20" step="1" />
<input class="neo-range-input" type="number" min="1" max="20" step="1" data-for="num_beams_textgenerationwebui" id="num_beams_counter_textgenerationwebui">
</div>
<div class="alignitemscenter flex-container marginBot5 flexFlowColumn flexGrow flexShrink gap0">
<small data-i18n="Length Penalty">Length Penalty</small>
<label>
<small data-i18n="Length Penalty">Length Penalty</small>
<div class="fa-solid fa-circle-info opacity50p" data-i18n="[title]Penalize sequences based on their length." title="Penalize sequences based on their length."></div>
</label>
<input class="neo-range-slider" type="range" id="length_penalty_textgenerationwebui" name="volume" min="-5" max="5" step="0.1" />
<input class="neo-range-input" type="number" min="-5" max="5" step="0.1" data-for="length_penalty_textgenerationwebui" id="length_penalty_counter_textgenerationwebui">
</div>
<div class="">
<label class="checkbox_label" for="early_stopping_textgenerationwebui">
<input type="checkbox" id="early_stopping_textgenerationwebui" />
<small data-i18n="Early Stopping">Early Stopping</small>
<input type="checkbox" id="early_stopping_textgenerationwebui" checked="false" />
<small data-i18n="Early Stopping">Early Stopping
<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>
</small>
</label>
</div>
</div>
@ -1487,7 +1495,10 @@
</div>
</div>
<div data-tg-type="mancer, ooba, koboldcpp, vllm, aphrodite, llamacpp, ollama, infermaticai, huggingface" class="flex-container flexFlowColumn alignitemscenter flexBasis48p flexGrow flexShrink gap0">
<small data-i18n="Seed" class="textAlignCenter">Seed</small>
<label>
<small data-i18n="Seed">Seed</small>
<div class="fa-solid fa-circle-info opacity50p " data-i18n="[title]Seed_desc" title="A random seed to use for deterministic and reproducable outputs. Set to -1 to use a random seed."></div>
</label>
<input type="number" id="seed_textgenerationwebui" class="text_pole textAlignCenter" min="-1" value="-1" />
</div>
<div id="banned_tokens_block_ooba" class="wide100p">

View File

@ -188,7 +188,6 @@ const settings = {
xtc_threshold: 0.1,
xtc_probability: 0,
include_stop_str_in_output: false,
guided_regex: '',
};
export let textgenerationwebui_banned_in_macros = [];
@ -262,7 +261,6 @@ export const setting_names = [
'xtc_threshold',
'xtc_probability',
'include_stop_str_in_output',
'guided_regex',
];
const DYNATEMP_BLOCK = document.getElementById('dynatemp_block_ooba');
@ -1207,7 +1205,7 @@ export function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate,
'presence_penalty': settings.presence_pen,
'repetition_penalty': settings.rep_pen,
'seed': settings.seed,
'stop': settings.stopping_strings,
'stop': getStoppingStrings(isImpersonate, isContinue),
'temperature': settings.temp,
'temperature_last': settings.temperature_last,
'top_p': settings.top_p,
@ -1221,6 +1219,7 @@ export function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate,
'smoothing_factor': settings.smoothing_factor,
'smoothing_curve': settings.smoothing_curve,
'use_beam_search': settings.use_beam_search,
'best_of': settings.num_beams > 1 ? settings.num_beams : settings.n,
'length_penalty': settings.length_penalty,
'early_stopping': settings.early_stopping,
'ignore_eos': settings.ignore_eos_token,
@ -1230,8 +1229,6 @@ export function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate,
'spaces_between_special_tokens': settings.spaces_between_special_tokens,
'guided_grammar': settings.grammar_string,
'guided_json': settings.json_schema,
};
if (settings.type === OPENROUTER) {
@ -1271,7 +1268,8 @@ export function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate,
break;
case APHRODITE:
params = Object.assign(aphroditeParams);
// set params to aphroditeParams
params = Object.assign(params, aphroditeParams);
break;
default: