mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Logit bias (start)
This commit is contained in:
@ -296,16 +296,20 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div id="openai_api-presets">
|
<div id="openai_api-presets">
|
||||||
<h3>OpenAI Presets</h3>
|
<div>
|
||||||
<select id="settings_perset_openai">
|
<h3>OpenAI Presets</h3>
|
||||||
<option value="gui">Default</option>
|
<select id="settings_perset_openai">
|
||||||
</select>
|
<option value="gui">Default</option>
|
||||||
<h4>OpenAI Model</h4>
|
</select>
|
||||||
<select id="model_openai_select">
|
</div>
|
||||||
<option value="gpt-3.5-turbo">gpt-3.5-turbo</option>
|
<div>
|
||||||
<option value="gpt-3.5-turbo-0301">gpt-3.5-turbo-0301</option>
|
<h4>OpenAI Model</h4>
|
||||||
<option value="gpt-4">gpt-4</option>
|
<select id="model_openai_select">
|
||||||
</select>
|
<option value="gpt-3.5-turbo">gpt-3.5-turbo</option>
|
||||||
|
<option value="gpt-3.5-turbo-0301">gpt-3.5-turbo-0301</option>
|
||||||
|
<option value="gpt-4">gpt-4</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="textgenerationwebui_api-presets">
|
<div id="textgenerationwebui_api-presets">
|
||||||
<h3>Text generation web UI presets</h3>
|
<h3>Text generation web UI presets</h3>
|
||||||
@ -490,6 +494,31 @@
|
|||||||
<input type="range" id="pres_pen_openai" name="volume" min="-2" max="2" step="0.01">
|
<input type="range" id="pres_pen_openai" name="volume" min="-2" max="2" step="0.01">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div style="display:none" class="range-block">
|
||||||
|
<div class="range-block-title">
|
||||||
|
Logit Bias
|
||||||
|
</div>
|
||||||
|
<div class="openai_logit_bias">
|
||||||
|
<div class="openai_logit_bias_form">
|
||||||
|
<input class="text_pole" id="openai_logit_bias_text" placeholder="text (will be converted to tokens)" />
|
||||||
|
<div class="openai_logit_bias_range_block">
|
||||||
|
<div class="range-block-counter">
|
||||||
|
<span id="openai_logit_bias_value_counter">select</span>
|
||||||
|
</div>
|
||||||
|
<input id="openai_logit_bias_value" type="range" min="-100" value="0" max="100" />
|
||||||
|
</div>
|
||||||
|
<input class="menu_button" id="openai_logit_bias_add" type="button" value="Add" />
|
||||||
|
</div>
|
||||||
|
<div class="openai_logit_bias_list">
|
||||||
|
<div class="openai_logit_bias_list_item">
|
||||||
|
<span class="token_id">666</span>
|
||||||
|
<span class="separator">:</span>
|
||||||
|
<span class="bias_value">-100</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -2118,6 +2118,10 @@ function changeMainAPI() {
|
|||||||
apiObj.apiRanges.css("display", isCurrentApi ? "block" : "none");
|
apiObj.apiRanges.css("display", isCurrentApi ? "block" : "none");
|
||||||
apiObj.apiPresets.css("display", isCurrentApi ? "block" : "none");
|
apiObj.apiPresets.css("display", isCurrentApi ? "block" : "none");
|
||||||
|
|
||||||
|
if (isCurrentApi && apiName === "openai") {
|
||||||
|
apiObj.apiPresets.css("display", "flex");
|
||||||
|
}
|
||||||
|
|
||||||
if (isCurrentApi && apiName === "kobold") {
|
if (isCurrentApi && apiName === "kobold") {
|
||||||
//console.log("enabling SP for kobold");
|
//console.log("enabling SP for kobold");
|
||||||
$("#softprompt_block").css("display", "block");
|
$("#softprompt_block").css("display", "block");
|
||||||
|
@ -2901,7 +2901,61 @@ filter: invert(20%) sepia(100%) saturate(2518%) hue-rotate(353deg) brightness(93
|
|||||||
|
|
||||||
.widthFreeExpand {width: unset;}
|
.widthFreeExpand {width: unset;}
|
||||||
|
|
||||||
|
#openai_api-presets {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
column-gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#openai_api-presets > div {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#openai_api-presets select {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#openai_logit_bias_text, .openai_logit_bias_range_block {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.openai_logit_bias_form .range-block-counter {
|
||||||
|
margin-top: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.openai_logit_bias_form {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
column-gap: 10px;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.openai_logit_bias_list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
column-gap: 10px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.openai_logit_bias_list_item .separator {
|
||||||
|
margin: 0 3px;
|
||||||
|
display: block;
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 1.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.openai_logit_bias_list_item {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: baseline;
|
||||||
|
background-color: var(--ivory);
|
||||||
|
color: var(--black100);
|
||||||
|
font-weight: 500;
|
||||||
|
border-radius: 20px;
|
||||||
|
min-height: fit-content;
|
||||||
|
padding: 3px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ---------- @media queries must always go at the bottom ------------*/
|
/* ---------- @media queries must always go at the bottom ------------*/
|
||||||
|
Reference in New Issue
Block a user