|
@@ -17,6 +17,7 @@
|
|
|
stop: null,
|
|
|
temperature: null,
|
|
|
reasoning_effort: null,
|
|
|
+ logit_bias: null,
|
|
|
frequency_penalty: null,
|
|
|
repeat_last_n: null,
|
|
|
mirostat: null,
|
|
@@ -298,6 +299,49 @@
|
|
|
{/if}
|
|
|
</div>
|
|
|
|
|
|
+ <div class=" py-0.5 w-full justify-between">
|
|
|
+ <Tooltip
|
|
|
+ content={$i18n.t(
|
|
|
+ 'Boosting or penalizing specific tokens for constrained responses. Bias values will be normalized to be between -100 and 100 (inclusive). (Default: none)'
|
|
|
+ )}
|
|
|
+ placement="top-start"
|
|
|
+ className="inline-tooltip"
|
|
|
+ >
|
|
|
+ <div class="flex w-full justify-between">
|
|
|
+ <div class=" self-center text-xs font-medium">
|
|
|
+ {$i18n.t('Logit Bias')}
|
|
|
+ </div>
|
|
|
+ <button
|
|
|
+ class="p-1 px-3 text-xs flex rounded-sm transition shrink-0 outline-hidden"
|
|
|
+ type="button"
|
|
|
+ on:click={() => {
|
|
|
+ params.logit_bias = (params?.logit_bias ?? null) === null ? '' : null;
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {#if (params?.logit_bias ?? null) === null}
|
|
|
+ <span class="ml-2 self-center"> {$i18n.t('Default')} </span>
|
|
|
+ {:else}
|
|
|
+ <span class="ml-2 self-center"> {$i18n.t('Custom')} </span>
|
|
|
+ {/if}
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ </Tooltip>
|
|
|
+
|
|
|
+ {#if (params?.logit_bias ?? null) !== null}
|
|
|
+ <div class="flex mt-0.5 space-x-2">
|
|
|
+ <div class=" flex-1">
|
|
|
+ <input
|
|
|
+ class="w-full rounded-lg py-2 px-1 text-sm dark:text-gray-300 dark:bg-gray-850 outline-hidden"
|
|
|
+ type="text"
|
|
|
+ placeholder={$i18n.t('Enter logit bias as comma-seperated "token_id:bias_value" pairs')}
|
|
|
+ bind:value={params.logit_bias}
|
|
|
+ autocomplete="off"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ {/if}
|
|
|
+ </div>
|
|
|
+
|
|
|
<div class=" py-0.5 w-full justify-between">
|
|
|
<Tooltip
|
|
|
content={$i18n.t(
|