Skip to content

Commit 98dde9d

Browse files
ConcedoConcedo
Concedo
authored and
Concedo
committed
tidy up some samplers
1 parent 088751a commit 98dde9d

File tree

1 file changed

+114
-91
lines changed

1 file changed

+114
-91
lines changed

index.html

+114-91
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
-->
1313

1414
<script>
15-
const LITEVER = 150;
15+
const LITEVER = 151;
1616
const urlParams = new URLSearchParams(window.location.search);
1717
const localflag = urlParams.get('local');
1818
const STORAGE_PREFIX = (localflag?"e_":"")+"kaihordewebui_";
@@ -210,6 +210,7 @@
210210
{
211211
height: calc(75vh - 110px);
212212
overflow-y: auto;
213+
overflow-x: hidden;
213214
}
214215

215216
body.connected .settingsmenu,
@@ -876,6 +877,7 @@
876877
background: #ffffff;
877878
border: 1px solid white;
878879
text-decoration: none;
880+
/* position: relative; */
879881
}
880882

881883
.helpicon:hover {
@@ -897,7 +899,11 @@
897899
}
898900
@media (max-width: 680px) {
899901
.helpicon:hover .helptext {
900-
right: 0;
902+
margin: 0 0 auto;
903+
position: fixed;
904+
top: 20%;
905+
left: 50%;
906+
transform: translate(-50%, -50%);
901907
}
902908
}
903909

@@ -1117,6 +1123,11 @@
11171123
.settingitem.wide{
11181124
width: 100%;
11191125
}
1126+
.settingcell
1127+
{
1128+
padding: 4px;
1129+
width: 100%;
1130+
}
11201131

11211132
.settingsdesctxt
11221133
{
@@ -7419,7 +7430,7 @@
74197430
function confirm_dynatemp()
74207431
{
74217432
document.getElementById("dynatempcontainer").classList.add("hidden");
7422-
document.getElementById("dynatemp_overview").innerText = ((document.getElementById("dynatemp_range").value>0||document.getElementById("smoothing_factor").value>0)?"ON":"OFF");
7433+
document.getElementById("dynatemp_overview").innerText = (document.getElementById("dynatemp_range").value>0?"ON":"OFF");
74237434
}
74247435
function show_dynatemp()
74257436
{
@@ -9123,10 +9134,10 @@
91239134
document.getElementById("dynatemp_range").value = localsettings.dynatemp_range;
91249135
document.getElementById("dynatemp_exponent").value = localsettings.dynatemp_exponent;
91259136
document.getElementById("smoothing_factor").value = localsettings.smoothing_factor;
9126-
document.getElementById("dynatemp_overview").innerText = ((localsettings.dynatemp_range>0||localsettings.smoothing_factor>0)?"ON":"OFF");
9137+
document.getElementById("dynatemp_overview").innerText = (localsettings.dynatemp_range>0?"ON":"OFF");
91279138
document.getElementById("presence_penalty").value = localsettings.presence_penalty;
91289139
document.getElementById("sampler_seed").value = localsettings.sampler_seed;
9129-
document.getElementById("top_k").value = localsettings.top_k;
9140+
document.getElementById("top_k").value = document.getElementById("top_k_slide").value = localsettings.top_k;
91309141
document.getElementById("top_a").value = localsettings.top_a;
91319142
document.getElementById("typ_s").value = localsettings.typ_s;
91329143
document.getElementById("tfs_s").value = localsettings.tfs_s;
@@ -9271,7 +9282,7 @@
92719282
document.getElementById("dynatemp_range").value = found.dynatemp_range;
92729283
document.getElementById("dynatemp_exponent").value = found.dynatemp_exponent;
92739284
document.getElementById("smoothing_factor").value = found.smoothing_factor;
9274-
document.getElementById("top_k").value = found.top_k;
9285+
document.getElementById("top_k").value = document.getElementById("top_k_slide").value = found.top_k;
92759286
document.getElementById("top_p").value = document.getElementById("top_p_slide").value = found.top_p;
92769287
document.getElementById("top_a").value = found.top_a;
92779288
document.getElementById("typ_s").value = found.typical;
@@ -9282,6 +9293,7 @@
92829293
document.getElementById("rep_pen_slope").value = found.rep_pen_slope;
92839294
document.getElementById("sampler_order").value = found.sampler_order.toString();
92849295
document.getElementById("presetsdesc").innerText = found.description;
9296+
document.getElementById("dynatemp_overview").innerText = (document.getElementById("dynatemp_range").value>0?"ON":"OFF");
92859297
}else{
92869298
document.getElementById("presetsdesc").innerText = "";
92879299
}
@@ -16965,12 +16977,10 @@
1696516977
<div class="settingitem">
1696616978
<div class="settinglabel">
1696716979
<div class="justifyleft settingsmall">Context Size <span class="helpicon">?<span class="helptext">Maximum number of context tokens submitted to the AI. Must exceed max output tokens. Can be further increased by editing the textbox. Older models stop at 2048, newer ones can do 4096 or greater.</span></span></div>
16968-
<input inputmode="numeric" class="justifyright flex-push-right settingsmall widerinput" id="max_context_length"
16969-
value=1024 oninput="
16980+
<input inputmode="numeric" class="justifyright flex-push-right settingsmall widerinput" id="max_context_length" oninput="
1697016981
document.getElementById('max_context_length_slide').value = this.value;">
1697116982
</div>
16972-
<div><input type="range" class="form-range airange" min="512" max="2048" step="8"
16973-
id="max_context_length_slide" oninput="
16983+
<div><input type="range" class="form-range airange" min="512" max="2048" step="8" id="max_context_length_slide" oninput="
1697416984
document.getElementById('max_context_length').value = this.value;"></div>
1697516985
<div class="settingminmax">
1697616986
<div class="justifyleft">512</div>
@@ -16986,12 +16996,10 @@
1698616996
<div class="settinglabel">
1698716997
<div class="justifyleft settingsmall">Max Output <span class="helpicon">?<span
1698816998
class="helptext">Number of tokens the AI should generate. Higher numbers will take longer to generate.</span></span></div>
16989-
<input inputmode="numeric" class="justifyright flex-push-right settingsmall" id="max_length" value=80
16990-
oninput="
16999+
<input inputmode="numeric" class="justifyright flex-push-right settingsmall" id="max_length" oninput="
1699117000
document.getElementById('max_length_slide').value = this.value;">
1699217001
</div>
16993-
<div><input type="range" class="form-range airange" min="16" max="512" step="2"
16994-
id="max_length_slide" oninput="
17002+
<div><input type="range" class="form-range airange" min="16" max="512" step="2" id="max_length_slide" oninput="
1699517003
document.getElementById('max_length').value = this.value;"></div>
1699617004
<div class="settingminmax">
1699717005
<div class="justifyleft">16</div>
@@ -17010,8 +17018,7 @@
1701017018
may make text less sensible. Lower values will make text more predictable but
1701117019
can become repetitious.</span></span></div>
1701217020
<input inputmode="decimal" class="justifyright flex-push-right settingsmall" id="temperature" value=0.5
17013-
oninput="
17014-
document.getElementById('temperature_slide').value = this.value;">
17021+
oninput="document.getElementById('temperature_slide').value = this.value;">
1701517022
</div>
1701617023
<div><input type="range" class="form-range airange" min="0.1" max="2" step="0.01"
1701717024
id="temperature_slide" oninput="
@@ -17022,17 +17029,32 @@
1702217029
</div>
1702317030
</div>
1702417031

17032+
<div class="settingitem">
17033+
<div class="settinglabel">
17034+
<div class="justifyleft settingsmall">Repetition Penalty <span class="helpicon">?<span
17035+
class="helptext">Used to penalize words that were already generated or belong to
17036+
the context (too high causes incoherence!).</span></span></div>
17037+
<input inputmode="decimal" class="justifyright flex-push-right settingsmall" id="rep_pen" oninput="
17038+
document.getElementById('rep_pen_slide').value = this.value;">
17039+
</div>
17040+
<div><input type="range" class="form-range airange" min="1" max="2" step="0.01"
17041+
id="rep_pen_slide" oninput="document.getElementById('rep_pen').value = this.value;"></div>
17042+
<div class="settingminmax">
17043+
<div class="justifyleft">1</div>
17044+
<div class="justifyright">2</div>
17045+
</div>
17046+
</div>
17047+
1702517048
<div class="settingitem">
1702617049
<div class="settinglabel">
1702717050
<div class="justifyleft settingsmall">Top p Sampling <span class="helpicon">?<span class="helptext">Used
17028-
to discard unlikely text in the sampling process. Lower values will make text
17051+
to discard unlikely text in a nucleus sampling process. Lower values will make text
1702917052
more predictable but can become repetitious. Set to 1 to deactivate it.</span></span></div>
17030-
<input inputmode="decimal" class="justifyright flex-push-right settingsmall" id="top_p" value=80 oninput="
17053+
<input inputmode="decimal" class="justifyright flex-push-right settingsmall" id="top_p" oninput="
1703117054
document.getElementById('top_p_slide').value = this.value;">
1703217055
</div>
1703317056
<div><input type="range" class="form-range airange" min="0" max="1" step="0.01" id="top_p_slide"
17034-
oninput="
17035-
document.getElementById('top_p').value = this.value;"></div>
17057+
oninput="document.getElementById('top_p').value = this.value;"></div>
1703617058
<div class="settingminmax">
1703717059
<div class="justifyleft">0</div>
1703817060
<div class="justifyright">1</div>
@@ -17041,67 +17063,82 @@
1704117063

1704217064
<div class="settingitem">
1704317065
<div class="settinglabel">
17044-
<div class="justifyleft settingsmall">Repetition Penalty <span class="helpicon">?<span
17045-
class="helptext">Used to penalize words that were already generated or belong to
17046-
the context (too high causes incoherence!).</span></span></div>
17047-
<input inputmode="decimal" class="justifyright flex-push-right settingsmall" id="rep_pen" value=80
17048-
oninput="
17049-
document.getElementById('rep_pen_slide').value = this.value;">
17066+
<div class="justifyleft settingsmall">Top k Sampling <span class="helpicon">?<span class="helptext">Top-K Sampling. Discards all but the K most likely tokens. Set 0 to Deactivate.</span></span></div>
17067+
<input inputmode="decimal" class="justifyright flex-push-right settingsmall" id="top_k" oninput="
17068+
document.getElementById('top_k_slide').value = this.value;">
1705017069
</div>
17051-
<div><input type="range" class="form-range airange" min="1" max="2" step="0.01"
17052-
id="rep_pen_slide" oninput="
17053-
document.getElementById('rep_pen').value = this.value;"></div>
17070+
<div><input type="range" class="form-range airange" min="0" max="100" step="1" id="top_k_slide"
17071+
oninput="document.getElementById('top_k').value = this.value;"></div>
1705417072
<div class="settingminmax">
17055-
<div class="justifyleft">1</div>
17056-
<div class="justifyright">2</div>
17073+
<div class="justifyleft">0</div>
17074+
<div class="justifyright">1</div>
1705717075
</div>
1705817076
</div>
1705917077

17060-
<div class="settingitem">
17078+
<div class="settingitem wide">
1706117079
<div class="settinglabel">
1706217080
<div class="justifyleft settingsmall">Advanced Sampler Config <span class="helpicon">?<span class="helptext">These settings control alternative samplers configurations. They are inactive by default, you usually do not need to change them.</span></span></div>
17063-
<table class="settingsmall text-center" style="border-spacing: 3px 2px;
17064-
border-collapse: separate;">
17065-
<tr>
17066-
<th title="Top-K Sampling. 0 to Deactivate.">Top-K</th>
17067-
<th title="Top-A Sampling. 0 to Deactivate.">Top-A</th>
17068-
<th title="Typical Sampling. 1 to Deactivate.">Typ.</th>
17069-
<th title="Tail-Free Sampling. 1 to Deactivate.">TFS</th>
17070-
</tr>
17071-
<tr>
17072-
<td><input class="" type="text" inputmode="decimal" placeholder="0" value="0"
17073-
id="top_k"></td>
17074-
<td><input class="" type="text" inputmode="decimal" placeholder="0" value="0"
17075-
id="top_a"></td>
17076-
<td><input class="" type="text" inputmode="decimal" placeholder="0" value="0"
17077-
id="typ_s"></td>
17078-
<td><input class="" type="text" inputmode="decimal" placeholder="0" value="0"
17079-
id="tfs_s"></td>
17080-
</tr>
17081-
17082-
<tr>
17083-
<th title="Sampler Seed. -1 to Deactivate.">Seed</th>
17084-
<th title="Min-P Sampling. 0 to Deactivate.">Min-P</th>
17085-
<th title="Presence Penalty. 0 to Deactivate.">PrPen.</th>
17086-
<th title="DynaTemp Configs. Range 0 to Deactivate.">DyTmp.</th>
17087-
</tr>
17088-
<tr>
17089-
17090-
<td><input class="" type="text" inputmode="decimal" placeholder="0" value="0"
17091-
id="sampler_seed"></td>
17092-
<td><input class="" type="text" inputmode="decimal" placeholder="0" value="0"
17093-
id="min_p"></td>
17094-
<td><input class="" type="text" inputmode="decimal" placeholder="0" value="0"
17095-
id="presence_penalty"></td>
17096-
<td><button type="button" class="btn btn-primary" style="padding:1px 3px;font-size:8px;" onclick="show_dynatemp()"><span id="dynatemp_overview">OFF</span></button></td>
17097-
</tr>
17098-
17099-
17100-
</table>
17101-
17081+
</div>
17082+
<div style="display:flex;width:100%;">
17083+
<div class="settinglabel settingcell">
17084+
<div title="Top-A Sampling. 0 to Deactivate." class="justifyleft settingsmall" style="width:100%">Top-A</div>
17085+
<div class="justifyleft settingsmall" style="width:100%">
17086+
<input class="settinglabel miniinput" type="text" inputmode="decimal" placeholder="0" value="0" id="top_a"></div>
17087+
</div>
17088+
<div class="settinglabel settingcell">
17089+
<div title="Typical Sampling. 1 to Deactivate." class="justifyleft settingsmall" style="width:100%">Typical</div>
17090+
<div class="justifyleft settingsmall" style="width:100%">
17091+
<input class="settinglabel miniinput" type="text" inputmode="decimal" placeholder="0" value="0" id="typ_s"></div>
17092+
</div>
17093+
<div class="settinglabel settingcell">
17094+
<div title="Tail-Free Sampling. 1 to Deactivate." class="justifyleft settingsmall" style="width:100%">TFS</div>
17095+
<div class="justifyleft settingsmall" style="width:100%">
17096+
<input class="settinglabel miniinput" type="text" inputmode="decimal" placeholder="0" value="0" id="tfs_s"></div>
17097+
</div>
17098+
<div class="settinglabel settingcell">
17099+
<div title="Min-P Sampling. 0 to Deactivate." class="justifyleft settingsmall" style="width:100%">Min-P</div>
17100+
<div class="justifyleft settingsmall" style="width:100%">
17101+
<input class="settinglabel miniinput" type="text" inputmode="decimal" placeholder="0" value="0" id="min_p"></div>
17102+
</div>
17103+
<div class="settinglabel settingcell">
17104+
<div title="Presence Penalty. 0 to Deactivate." class="justifyleft settingsmall" style="width:100%">Pr. Pen.</div>
17105+
<div class="justifyleft settingsmall" style="width:100%">
17106+
<input class="settinglabel miniinput" type="text" inputmode="decimal" placeholder="0" value="0" id="presence_penalty"></div>
17107+
</div>
17108+
</div>
17109+
<div style="display:flex;width:100%;">
17110+
<div class="settinglabel settingcell">
17111+
<div title="Sampler Seed. -1 to Deactivate." class="justifyleft settingsmall" style="width:100%">Seed</div>
17112+
<div class="justifyleft settingsmall" style="width:100%">
17113+
<input class="settinglabel miniinput" type="text" inputmode="decimal" placeholder="0" value="0" id="sampler_seed"></div>
17114+
</div>
17115+
<div class="settinglabel settingcell">
17116+
<div title="Repetition Penalty Range" class="justifyleft settingsmall" style="width:100%">Rp.Range</div>
17117+
<div class="justifyleft settingsmall" style="width:100%">
17118+
<input class="settinglabel miniinput" type="text" inputmode="decimal" placeholder="0" value="0" id="rep_pen_range"></div>
17119+
</div>
17120+
<div class="settinglabel settingcell">
17121+
<div title="Repetition Penalty Slope" class="justifyleft settingsmall" style="width:100%">Rp.Slope</div>
17122+
<div class="justifyleft settingsmall" style="width:100%">
17123+
<input class="settinglabel miniinput" type="text" inputmode="decimal" placeholder="0" value="0" id="rep_pen_slope"></div>
17124+
</div>
17125+
<div class="settinglabel settingcell">
17126+
<div title="Sampler Order" class="justifyleft settingsmall" style="width:100%">Smp.Order <span class="helpicon">?<span class="helptext">
17127+
The order by which all 7 samplers are applied, separated by commas. 0=top_k, 1=top_a, 2=top_p, 3=tfs, 4=typ, 5=temp, 6=rep_pen</span></span></div>
17128+
<div class="justifyleft settingsmall" style="width:100%">
17129+
<input class="settinglabel miniinput" type="text" placeholder="CSV" value="" id="sampler_order" title="Valid values are: 0=top_k, 1=top_a, 2=top_p, 3=tfs, 4=typ, 5=temp, 6=rep_pen" onblur="validate_samplers()"></div>
17130+
</div>
17131+
<div class="settinglabel settingcell">
17132+
<div title="DynaTemp Configs. Range 0 to Deactivate." class="justifyleft settingsmall" style="width:100%">DyTemp</div>
17133+
<div class="justifyleft settingsmall" style="width:100%">
17134+
<button type="button" class="btn btn-primary" style="padding:1px 3px;font-size:8px;" onclick="show_dynatemp()"><span id="dynatemp_overview">OFF</span></button>
17135+
</div>
17136+
</div>
1710217137
</div>
1710317138
</div>
1710417139

17140+
17141+
1710517142
<div class="settingitem">
1710617143
<div class="settinglabel">
1710717144

@@ -17128,31 +17165,13 @@
1712817165
</table>
1712917166
</div>
1713017167
<div id="mirounsupporteddiv" class="color_red" style="font-weight:bold;padding:3px;font-size:12px">Mirostat Not Supported</div>
17131-
<div class="settinglabel">
17132-
<div class="justifyleft settingsmall">User Mods <span class="helpicon">?<span class="helptext">Allows you to load third-party user created mods (caution).</span></span></div>
17133-
<button id="loadusermod" type="button" class="btn btn-primary" style="padding:2px 3px;margin-top:2px;font-size:11px;" onclick="apply_user_mod()">Apply User Mod</button>
17134-
</div>
17168+
1713517169
</div>
1713617170
</div>
1713717171

1713817172
<div class="settingitem">
1713917173
<div class="settinglabel">
17140-
<table class="settingsmall text-center" style="border-spacing: 3px 2px;
17141-
border-collapse: separate;">
17142-
<tr>
17143-
<th title="Repetition Penalty Range">RpRng.</th>
17144-
<th title="Repetition Penalty Slope">RpSlp.</th>
17145-
<th style="width:80px;">Smp.Order <span class="helpicon">?<span
17146-
class="helptext">The order by which all 7 samplers are applied, separated by commas. 0=top_k, 1=top_a, 2=top_p, 3=tfs, 4=typ, 5=temp, 6=rep_pen</span></span></th>
17147-
</tr>
17148-
<tr>
17149-
<td><input class="" type="text" placeholder="0" value="0"
17150-
id="rep_pen_range" title="Repetition Penalty Range"></td>
17151-
<td><input class="" type="text" placeholder="0" value="0"
17152-
id="rep_pen_slope" title="Repetition Penalty Slope"></td>
17153-
<td><input class="" type="text" placeholder="CSV" value="" id="sampler_order" style="width:70px;" title="Valid values are: 0=top_k, 1=top_a, 2=top_p, 3=tfs, 4=typ, 5=temp, 6=rep_pen" onblur="validate_samplers()"></td>
17154-
</tr>
17155-
</table>
17174+
1715617175
</div>
1715717176

1715817177
</div>
@@ -17458,6 +17477,10 @@
1745817477
class="helptext">Prevents the browser from suspending KoboldAI Lite by playing a silent audio track. This setting cannot be saved.</span></span></div>
1745917478
<input type="checkbox" id="run_in_background" style="margin:0px 0px 0px auto;">
1746017479
</div>
17480+
<div class="settinglabel">
17481+
<div class="justifyleft settingsmall">User Mods <span class="helpicon">?<span class="helptext">Allows you to load third-party user created mods (caution).</span></span></div>
17482+
<button id="loadusermod" type="button" class="btn btn-primary" style="padding:2px 3px;margin-top:2px;font-size:11px;margin:0px 0px 0px auto;" onclick="apply_user_mod()">Apply User Mod</button>
17483+
</div>
1746117484
</div>
1746217485

1746317486

0 commit comments

Comments
 (0)