Add parameter disabling
This commit is contained in:
@@ -303,23 +303,23 @@
|
|||||||
<span class="text-textcolor">{language.temperature} <Help key="tempature"/></span>
|
<span class="text-textcolor">{language.temperature} <Help key="tempature"/></span>
|
||||||
|
|
||||||
{#if $DataBase.aiModel.startsWith("novelai")}
|
{#if $DataBase.aiModel.startsWith("novelai")}
|
||||||
<SliderInput min={0} max={250} marginBottom bind:value={$DataBase.temperature} multiple={0.01} fixed={2}/>
|
<SliderInput min={0} max={250} marginBottom bind:value={$DataBase.temperature} multiple={0.01} fixed={2} disableable/>
|
||||||
{:else}
|
{:else}
|
||||||
<SliderInput min={0} max={200} marginBottom bind:value={$DataBase.temperature} multiple={0.01} fixed={2}/>
|
<SliderInput min={0} max={200} marginBottom bind:value={$DataBase.temperature} multiple={0.01} fixed={2} disableable/>
|
||||||
{/if}
|
{/if}
|
||||||
{#if $DataBase.aiModel.startsWith('openrouter') || $DataBase.aiModel.startsWith('claude-3') || $DataBase.aiModel.startsWith('cohere-')}
|
{#if $DataBase.aiModel.startsWith('openrouter') || $DataBase.aiModel.startsWith('claude-3') || $DataBase.aiModel.startsWith('cohere-')}
|
||||||
<span class="text-textcolor">Top K</span>
|
<span class="text-textcolor">Top K</span>
|
||||||
<SliderInput min={0} max={100} marginBottom step={1} bind:value={$DataBase.top_k}/>
|
<SliderInput min={0} max={100} marginBottom step={1} bind:value={$DataBase.top_k} disableable/>
|
||||||
{/if}
|
{/if}
|
||||||
{#if $DataBase.aiModel.startsWith('openrouter')}
|
{#if $DataBase.aiModel.startsWith('openrouter')}
|
||||||
<span class="text-textcolor">Repetition penalty</span>
|
<span class="text-textcolor">Repetition penalty</span>
|
||||||
<SliderInput min={0} max={2} marginBottom step={0.01} fixed={2} bind:value={$DataBase.repetition_penalty}/>
|
<SliderInput min={0} max={2} marginBottom step={0.01} fixed={2} bind:value={$DataBase.repetition_penalty} disableable/>
|
||||||
|
|
||||||
<span class="text-textcolor">Min P</span>
|
<span class="text-textcolor">Min P</span>
|
||||||
<SliderInput min={0} max={1} marginBottom step={0.01} fixed={2} bind:value={$DataBase.min_p}/>
|
<SliderInput min={0} max={1} marginBottom step={0.01} fixed={2} bind:value={$DataBase.min_p} disableable/>
|
||||||
|
|
||||||
<span class="text-textcolor">Top A</span>
|
<span class="text-textcolor">Top A</span>
|
||||||
<SliderInput min={0} max={1} marginBottom step={0.01} fixed={2} bind:value={$DataBase.top_a}/>
|
<SliderInput min={0} max={1} marginBottom step={0.01} fixed={2} bind:value={$DataBase.top_a} disableable/>
|
||||||
{/if}
|
{/if}
|
||||||
{#if $DataBase.aiModel === 'textgen_webui' || $DataBase.aiModel === 'mancer' || $DataBase.aiModel.startsWith('local_') || $DataBase.aiModel.startsWith('hf:::')}
|
{#if $DataBase.aiModel === 'textgen_webui' || $DataBase.aiModel === 'mancer' || $DataBase.aiModel.startsWith('local_') || $DataBase.aiModel.startsWith('hf:::')}
|
||||||
<span class="text-textcolor">Repetition Penalty</span>
|
<span class="text-textcolor">Repetition Penalty</span>
|
||||||
@@ -439,17 +439,17 @@
|
|||||||
<SliderInput min={0} max={1} step={0.01} marginBottom fixed={2} bind:value={$DataBase.ainconfig.typical_p}/>
|
<SliderInput min={0} max={1} step={0.01} marginBottom fixed={2} bind:value={$DataBase.ainconfig.typical_p}/>
|
||||||
{:else if $DataBase.aiModel.startsWith('claude')}
|
{:else if $DataBase.aiModel.startsWith('claude')}
|
||||||
<span class="text-textcolor">Top P <Help key="topP"/></span>
|
<span class="text-textcolor">Top P <Help key="topP"/></span>
|
||||||
<SliderInput min={0} max={1} step={0.01} marginBottom fixed={2} bind:value={$DataBase.top_p}/>
|
<SliderInput min={0} max={1} step={0.01} marginBottom fixed={2} bind:value={$DataBase.top_p} disableable/>
|
||||||
{:else}
|
{:else}
|
||||||
|
|
||||||
|
|
||||||
<span class="text-textcolor">Top P <Help key="topP"/></span>
|
<span class="text-textcolor">Top P <Help key="topP"/></span>
|
||||||
<SliderInput min={0} max={1} step={0.01} marginBottom fixed={2} bind:value={$DataBase.top_p}/>
|
<SliderInput min={0} max={1} step={0.01} marginBottom fixed={2} bind:value={$DataBase.top_p} disableable/>
|
||||||
|
|
||||||
<span class="text-textcolor">{language.frequencyPenalty} <Help key="frequencyPenalty"/></span>
|
<span class="text-textcolor">{language.frequencyPenalty} <Help key="frequencyPenalty"/></span>
|
||||||
<SliderInput min={0} max={200} marginBottom fixed={2} multiple={0.01} bind:value={$DataBase.frequencyPenalty} />
|
<SliderInput min={0} max={200} marginBottom fixed={2} multiple={0.01} bind:value={$DataBase.frequencyPenalty} disableable/>
|
||||||
<span class="text-textcolor">{language.presensePenalty} <Help key="presensePenalty"/></span>
|
<span class="text-textcolor">{language.presensePenalty} <Help key="presensePenalty"/></span>
|
||||||
<SliderInput min={0} max={200} marginBottom fixed={2} multiple={0.01} bind:value={$DataBase.PresensePenalty} />
|
<SliderInput min={0} max={200} marginBottom fixed={2} multiple={0.01} bind:value={$DataBase.PresensePenalty} disableable/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if ($DataBase.reverseProxyOobaMode && $DataBase.aiModel === 'reverse_proxy') || ($DataBase.aiModel === 'ooba')}
|
{#if ($DataBase.reverseProxyOobaMode && $DataBase.aiModel === 'reverse_proxy') || ($DataBase.aiModel === 'ooba')}
|
||||||
|
|||||||
@@ -9,28 +9,42 @@
|
|||||||
on:change
|
on:change
|
||||||
> -->
|
> -->
|
||||||
|
|
||||||
<div class="w-full" class:mb-4={marginBottom}>
|
<div class="w-full flex" class:mb-4={marginBottom}>
|
||||||
|
{#if disableable}
|
||||||
|
|
||||||
|
<div class="relative h-8 border-darkborderc border rounded-full cursor-pointer rounded-r-none border-r-0 flex justify-center items-center">
|
||||||
|
<CheckInput check={value !== -1000} margin={false} onChange={(c) => {
|
||||||
|
if(c) {
|
||||||
|
value = min;
|
||||||
|
} else {
|
||||||
|
value = -1000;
|
||||||
|
}
|
||||||
|
}}></CheckInput>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
<div
|
<div
|
||||||
class="relative w-full h-8 border-darkborderc border rounded-full cursor-pointer"
|
class="relative w-full h-8 border-darkborderc border rounded-full cursor-pointer"
|
||||||
|
class:rounded-l-none={disableable}
|
||||||
style:background={
|
style:background={
|
||||||
`linear-gradient(to right, var(--risu-theme-darkbutton) 0%, var(--risu-theme-darkbutton) ${(value - min) / (max - min) * 100}%, var(--risu-theme-darkbg) ${(value - min) / (max - min) * 100}%, var(--risu-theme-darkbg) 100%)`
|
`linear-gradient(to right, var(--risu-theme-darkbutton) 0%, var(--risu-theme-darkbutton) ${(value - min) / (max - min) * 100}%, var(--risu-theme-darkbg) ${(value - min) / (max - min) * 100}%, var(--risu-theme-darkbg) 100%)`
|
||||||
}
|
}
|
||||||
on:mousedown={(event) => {
|
on:pointerdown={(event) => {
|
||||||
mouseDown = true;
|
mouseDown = true;
|
||||||
changeValue(event);
|
changeValue(event);
|
||||||
}}
|
}}
|
||||||
|
|
||||||
on:mousemove={(event) => {
|
on:pointermove={(event) => {
|
||||||
if (mouseDown) {
|
if (mouseDown) {
|
||||||
changeValue(event);
|
changeValue(event);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|
||||||
on:mouseup={() => {
|
|
||||||
mouseDown = false;
|
|
||||||
}}
|
|
||||||
|
|
||||||
on:mouseleave={() => {
|
on:pointerup={() => {
|
||||||
|
mouseDown = false;
|
||||||
|
}}
|
||||||
|
|
||||||
|
on:pointerleave={() => {
|
||||||
mouseDown = false;
|
mouseDown = false;
|
||||||
}}
|
}}
|
||||||
bind:this={slider}
|
bind:this={slider}
|
||||||
@@ -43,13 +57,16 @@
|
|||||||
<span
|
<span
|
||||||
class="absolute top-0 left-4 h-8 rounded-full items-center justify-center flex text-textcolor text-sm"
|
class="absolute top-0 left-4 h-8 rounded-full items-center justify-center flex text-textcolor text-sm"
|
||||||
>
|
>
|
||||||
{customText === undefined ? (value * multiple).toFixed(fixed) : customText}
|
{customText === undefined ? (value === -1000 ? language.disabled : (value * multiple).toFixed(fixed)) : customText}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { language } from "src/lang";
|
||||||
|
import CheckInput from "./CheckInput.svelte";
|
||||||
|
|
||||||
export let min:number = undefined
|
export let min:number = undefined
|
||||||
export let max:number = undefined
|
export let max:number = undefined
|
||||||
export let value:number
|
export let value:number
|
||||||
@@ -59,6 +76,7 @@
|
|||||||
export let multiple = 1
|
export let multiple = 1
|
||||||
let slider: HTMLDivElement
|
let slider: HTMLDivElement
|
||||||
let mouseDown = false
|
let mouseDown = false
|
||||||
|
export let disableable = false
|
||||||
export let customText: string|undefined = undefined
|
export let customText: string|undefined = undefined
|
||||||
|
|
||||||
function changeValue(event) {
|
function changeValue(event) {
|
||||||
|
|||||||
Reference in New Issue
Block a user