2024-02-05 17:58:54 +08:00
|
|
|
<script lang="ts">
|
2024-07-16 21:15:06 +08:00
|
|
|
import Switch from '$lib/components/common/Switch.svelte';
|
2024-05-25 13:21:57 +08:00
|
|
|
import { getContext, createEventDispatcher } from 'svelte';
|
|
|
|
|
|
|
|
const dispatch = createEventDispatcher();
|
2024-03-03 04:38:51 +08:00
|
|
|
|
|
|
|
const i18n = getContext('i18n');
|
|
|
|
|
2024-06-11 04:29:09 +08:00
|
|
|
export let admin = false;
|
|
|
|
|
2024-05-25 11:29:13 +08:00
|
|
|
export let params = {
|
2024-02-05 17:58:54 +08:00
|
|
|
// Advanced
|
2024-09-24 11:51:47 +08:00
|
|
|
stream_response: null, // Set stream responses for this model individually
|
2024-06-11 04:29:09 +08:00
|
|
|
seed: null,
|
2024-05-25 17:26:26 +08:00
|
|
|
stop: null,
|
2024-06-11 04:29:09 +08:00
|
|
|
temperature: null,
|
|
|
|
frequency_penalty: null,
|
|
|
|
repeat_last_n: null,
|
|
|
|
mirostat: null,
|
|
|
|
mirostat_eta: null,
|
|
|
|
mirostat_tau: null,
|
|
|
|
top_k: null,
|
|
|
|
top_p: null,
|
2024-08-03 00:10:12 +08:00
|
|
|
min_p: null,
|
2024-06-11 04:29:09 +08:00
|
|
|
tfs_z: null,
|
|
|
|
num_ctx: null,
|
2024-06-14 13:31:26 +08:00
|
|
|
num_batch: null,
|
|
|
|
num_keep: null,
|
2024-06-11 04:29:09 +08:00
|
|
|
max_tokens: null,
|
2024-06-03 04:20:38 +08:00
|
|
|
use_mmap: null,
|
|
|
|
use_mlock: null,
|
|
|
|
num_thread: null,
|
2024-08-13 09:46:38 +08:00
|
|
|
num_gpu: null,
|
2024-05-25 11:29:13 +08:00
|
|
|
template: null
|
2024-02-05 17:58:54 +08:00
|
|
|
};
|
2024-05-25 11:29:13 +08:00
|
|
|
|
|
|
|
let customFieldName = '';
|
|
|
|
let customFieldValue = '';
|
2024-05-25 13:21:57 +08:00
|
|
|
|
|
|
|
$: if (params) {
|
|
|
|
dispatch('change', params);
|
|
|
|
}
|
2024-02-05 17:58:54 +08:00
|
|
|
</script>
|
|
|
|
|
2024-09-08 23:36:51 +08:00
|
|
|
<div class=" space-y-1 text-xs pb-safe-bottom">
|
2024-09-24 11:51:47 +08:00
|
|
|
<div>
|
|
|
|
<div class=" py-0.5 flex w-full justify-between">
|
|
|
|
<div class=" self-center text-xs">
|
|
|
|
{$i18n.t('Stream Chat Response')}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<button
|
|
|
|
class="p-1 px-3 text-xs flex rounded transition"
|
|
|
|
on:click={() => {
|
|
|
|
params.stream_response = (params?.stream_response ?? null) === null ? true : (params.stream_response ? false : null);
|
|
|
|
}}
|
|
|
|
type="button"
|
|
|
|
>
|
|
|
|
{#if params.stream_response === true}
|
|
|
|
<span class="ml-2 self-center">{$i18n.t('On')}</span>
|
|
|
|
{:else if params.stream_response === false}
|
|
|
|
<span class="ml-2 self-center">{$i18n.t('Off')}</span>
|
|
|
|
{:else}
|
|
|
|
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
|
|
|
|
{/if}
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-05-25 11:29:13 +08:00
|
|
|
<div class=" py-0.5 w-full justify-between">
|
|
|
|
<div class="flex w-full justify-between">
|
|
|
|
<div class=" self-center text-xs font-medium">{$i18n.t('Seed')}</div>
|
|
|
|
|
|
|
|
<button
|
2024-07-09 10:26:31 +08:00
|
|
|
class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
|
2024-05-25 11:29:13 +08:00
|
|
|
type="button"
|
|
|
|
on:click={() => {
|
|
|
|
params.seed = (params?.seed ?? null) === null ? 0 : null;
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{#if (params?.seed ?? 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>
|
2024-02-05 17:58:54 +08:00
|
|
|
</div>
|
|
|
|
|
2024-05-25 11:29:13 +08:00
|
|
|
{#if (params?.seed ?? null) !== null}
|
|
|
|
<div class="flex mt-0.5 space-x-2">
|
|
|
|
<div class=" flex-1">
|
|
|
|
<input
|
|
|
|
class="w-full rounded-lg py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-850 outline-none"
|
|
|
|
type="number"
|
|
|
|
placeholder="Enter Seed"
|
|
|
|
bind:value={params.seed}
|
|
|
|
autocomplete="off"
|
|
|
|
min="0"
|
|
|
|
/>
|
|
|
|
</div>
|
2024-02-05 17:58:54 +08:00
|
|
|
</div>
|
2024-05-25 11:29:13 +08:00
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class=" py-0.5 w-full justify-between">
|
|
|
|
<div class="flex w-full justify-between">
|
|
|
|
<div class=" self-center text-xs font-medium">{$i18n.t('Stop Sequence')}</div>
|
|
|
|
|
|
|
|
<button
|
2024-07-09 10:26:31 +08:00
|
|
|
class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
|
2024-05-25 11:29:13 +08:00
|
|
|
type="button"
|
|
|
|
on:click={() => {
|
|
|
|
params.stop = (params?.stop ?? null) === null ? '' : null;
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{#if (params?.stop ?? 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>
|
2024-02-05 17:58:54 +08:00
|
|
|
</div>
|
2024-05-25 11:29:13 +08:00
|
|
|
|
|
|
|
{#if (params?.stop ?? null) !== null}
|
|
|
|
<div class="flex mt-0.5 space-x-2">
|
|
|
|
<div class=" flex-1">
|
|
|
|
<input
|
|
|
|
class="w-full rounded-lg py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-850 outline-none"
|
|
|
|
type="text"
|
|
|
|
placeholder={$i18n.t('Enter stop sequence')}
|
|
|
|
bind:value={params.stop}
|
|
|
|
autocomplete="off"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/if}
|
2024-02-05 17:58:54 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class=" py-0.5 w-full justify-between">
|
|
|
|
<div class="flex w-full justify-between">
|
2024-03-03 04:38:51 +08:00
|
|
|
<div class=" self-center text-xs font-medium">{$i18n.t('Temperature')}</div>
|
2024-02-05 17:58:54 +08:00
|
|
|
|
|
|
|
<button
|
2024-07-09 10:26:31 +08:00
|
|
|
class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
|
2024-02-05 17:58:54 +08:00
|
|
|
type="button"
|
|
|
|
on:click={() => {
|
2024-06-11 04:29:09 +08:00
|
|
|
params.temperature = (params?.temperature ?? null) === null ? 0.8 : null;
|
2024-02-05 17:58:54 +08:00
|
|
|
}}
|
|
|
|
>
|
2024-06-11 04:29:09 +08:00
|
|
|
{#if (params?.temperature ?? null) === null}
|
2024-03-03 04:38:51 +08:00
|
|
|
<span class="ml-2 self-center"> {$i18n.t('Default')} </span>
|
2024-02-05 17:58:54 +08:00
|
|
|
{:else}
|
2024-03-03 04:38:51 +08:00
|
|
|
<span class="ml-2 self-center"> {$i18n.t('Custom')} </span>
|
2024-02-05 17:58:54 +08:00
|
|
|
{/if}
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
2024-06-11 04:29:09 +08:00
|
|
|
{#if (params?.temperature ?? null) !== null}
|
2024-02-05 17:58:54 +08:00
|
|
|
<div class="flex mt-0.5 space-x-2">
|
|
|
|
<div class=" flex-1">
|
|
|
|
<input
|
|
|
|
id="steps-range"
|
|
|
|
type="range"
|
|
|
|
min="0"
|
|
|
|
max="1"
|
|
|
|
step="0.05"
|
2024-05-25 11:29:13 +08:00
|
|
|
bind:value={params.temperature}
|
2024-02-05 17:58:54 +08:00
|
|
|
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<input
|
2024-05-25 11:29:13 +08:00
|
|
|
bind:value={params.temperature}
|
2024-02-05 17:58:54 +08:00
|
|
|
type="number"
|
|
|
|
class=" bg-transparent text-center w-14"
|
|
|
|
min="0"
|
|
|
|
max="1"
|
2024-06-11 04:41:13 +08:00
|
|
|
step="any"
|
2024-02-05 17:58:54 +08:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class=" py-0.5 w-full justify-between">
|
|
|
|
<div class="flex w-full justify-between">
|
2024-03-03 04:38:51 +08:00
|
|
|
<div class=" self-center text-xs font-medium">{$i18n.t('Mirostat')}</div>
|
2024-02-05 17:58:54 +08:00
|
|
|
|
|
|
|
<button
|
2024-07-09 10:26:31 +08:00
|
|
|
class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
|
2024-02-05 17:58:54 +08:00
|
|
|
type="button"
|
|
|
|
on:click={() => {
|
2024-06-11 04:29:09 +08:00
|
|
|
params.mirostat = (params?.mirostat ?? null) === null ? 0 : null;
|
2024-02-05 17:58:54 +08:00
|
|
|
}}
|
|
|
|
>
|
2024-06-11 04:29:09 +08:00
|
|
|
{#if (params?.mirostat ?? null) === null}
|
2024-03-03 19:22:29 +08:00
|
|
|
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
|
2024-02-05 17:58:54 +08:00
|
|
|
{:else}
|
2024-05-25 11:29:13 +08:00
|
|
|
<span class="ml-2 self-center">{$i18n.t('Custom')}</span>
|
2024-02-05 17:58:54 +08:00
|
|
|
{/if}
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
2024-06-11 04:29:09 +08:00
|
|
|
{#if (params?.mirostat ?? null) !== null}
|
2024-02-05 17:58:54 +08:00
|
|
|
<div class="flex mt-0.5 space-x-2">
|
|
|
|
<div class=" flex-1">
|
|
|
|
<input
|
|
|
|
id="steps-range"
|
|
|
|
type="range"
|
|
|
|
min="0"
|
|
|
|
max="2"
|
|
|
|
step="1"
|
2024-05-25 11:29:13 +08:00
|
|
|
bind:value={params.mirostat}
|
2024-02-05 17:58:54 +08:00
|
|
|
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<input
|
2024-05-25 11:29:13 +08:00
|
|
|
bind:value={params.mirostat}
|
2024-02-05 17:58:54 +08:00
|
|
|
type="number"
|
|
|
|
class=" bg-transparent text-center w-14"
|
|
|
|
min="0"
|
|
|
|
max="2"
|
|
|
|
step="1"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class=" py-0.5 w-full justify-between">
|
|
|
|
<div class="flex w-full justify-between">
|
2024-03-03 04:38:51 +08:00
|
|
|
<div class=" self-center text-xs font-medium">{$i18n.t('Mirostat Eta')}</div>
|
2024-02-05 17:58:54 +08:00
|
|
|
|
|
|
|
<button
|
2024-07-09 10:26:31 +08:00
|
|
|
class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
|
2024-02-05 17:58:54 +08:00
|
|
|
type="button"
|
|
|
|
on:click={() => {
|
2024-06-11 04:29:09 +08:00
|
|
|
params.mirostat_eta = (params?.mirostat_eta ?? null) === null ? 0.1 : null;
|
2024-02-05 17:58:54 +08:00
|
|
|
}}
|
|
|
|
>
|
2024-06-11 04:29:09 +08:00
|
|
|
{#if (params?.mirostat_eta ?? null) === null}
|
2024-03-03 19:22:29 +08:00
|
|
|
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
|
2024-02-05 17:58:54 +08:00
|
|
|
{:else}
|
2024-05-25 11:29:13 +08:00
|
|
|
<span class="ml-2 self-center">{$i18n.t('Custom')}</span>
|
2024-02-05 17:58:54 +08:00
|
|
|
{/if}
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
2024-06-11 04:29:09 +08:00
|
|
|
{#if (params?.mirostat_eta ?? null) !== null}
|
2024-02-05 17:58:54 +08:00
|
|
|
<div class="flex mt-0.5 space-x-2">
|
|
|
|
<div class=" flex-1">
|
|
|
|
<input
|
|
|
|
id="steps-range"
|
|
|
|
type="range"
|
|
|
|
min="0"
|
|
|
|
max="1"
|
|
|
|
step="0.05"
|
2024-05-25 11:29:13 +08:00
|
|
|
bind:value={params.mirostat_eta}
|
2024-02-05 17:58:54 +08:00
|
|
|
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<input
|
2024-05-25 11:29:13 +08:00
|
|
|
bind:value={params.mirostat_eta}
|
2024-02-05 17:58:54 +08:00
|
|
|
type="number"
|
|
|
|
class=" bg-transparent text-center w-14"
|
|
|
|
min="0"
|
|
|
|
max="1"
|
2024-06-11 04:41:13 +08:00
|
|
|
step="any"
|
2024-02-05 17:58:54 +08:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class=" py-0.5 w-full justify-between">
|
|
|
|
<div class="flex w-full justify-between">
|
2024-03-03 04:38:51 +08:00
|
|
|
<div class=" self-center text-xs font-medium">{$i18n.t('Mirostat Tau')}</div>
|
2024-02-05 17:58:54 +08:00
|
|
|
|
|
|
|
<button
|
2024-07-09 10:26:31 +08:00
|
|
|
class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
|
2024-02-05 17:58:54 +08:00
|
|
|
type="button"
|
|
|
|
on:click={() => {
|
2024-06-11 04:29:09 +08:00
|
|
|
params.mirostat_tau = (params?.mirostat_tau ?? null) === null ? 5.0 : null;
|
2024-02-05 17:58:54 +08:00
|
|
|
}}
|
|
|
|
>
|
2024-06-11 04:29:09 +08:00
|
|
|
{#if (params?.mirostat_tau ?? null) === null}
|
2024-03-03 19:22:29 +08:00
|
|
|
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
|
2024-02-05 17:58:54 +08:00
|
|
|
{:else}
|
2024-03-03 19:22:29 +08:00
|
|
|
<span class="ml-2 self-center">{$i18n.t('Custom')}</span>
|
2024-02-05 17:58:54 +08:00
|
|
|
{/if}
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
2024-06-11 04:29:09 +08:00
|
|
|
{#if (params?.mirostat_tau ?? null) !== null}
|
2024-02-05 17:58:54 +08:00
|
|
|
<div class="flex mt-0.5 space-x-2">
|
|
|
|
<div class=" flex-1">
|
|
|
|
<input
|
|
|
|
id="steps-range"
|
|
|
|
type="range"
|
|
|
|
min="0"
|
|
|
|
max="10"
|
|
|
|
step="0.5"
|
2024-05-25 11:29:13 +08:00
|
|
|
bind:value={params.mirostat_tau}
|
2024-02-05 17:58:54 +08:00
|
|
|
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<input
|
2024-05-25 11:29:13 +08:00
|
|
|
bind:value={params.mirostat_tau}
|
2024-02-05 17:58:54 +08:00
|
|
|
type="number"
|
|
|
|
class=" bg-transparent text-center w-14"
|
|
|
|
min="0"
|
|
|
|
max="10"
|
2024-06-11 04:41:13 +08:00
|
|
|
step="any"
|
2024-02-05 17:58:54 +08:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class=" py-0.5 w-full justify-between">
|
|
|
|
<div class="flex w-full justify-between">
|
2024-03-03 04:38:51 +08:00
|
|
|
<div class=" self-center text-xs font-medium">{$i18n.t('Top K')}</div>
|
2024-02-05 17:58:54 +08:00
|
|
|
|
|
|
|
<button
|
2024-07-09 10:26:31 +08:00
|
|
|
class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
|
2024-02-05 17:58:54 +08:00
|
|
|
type="button"
|
|
|
|
on:click={() => {
|
2024-06-11 04:29:09 +08:00
|
|
|
params.top_k = (params?.top_k ?? null) === null ? 40 : null;
|
2024-02-05 17:58:54 +08:00
|
|
|
}}
|
|
|
|
>
|
2024-06-11 04:29:09 +08:00
|
|
|
{#if (params?.top_k ?? null) === null}
|
2024-03-03 19:22:29 +08:00
|
|
|
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
|
2024-02-05 17:58:54 +08:00
|
|
|
{:else}
|
2024-05-25 11:29:13 +08:00
|
|
|
<span class="ml-2 self-center">{$i18n.t('Custom')}</span>
|
2024-02-05 17:58:54 +08:00
|
|
|
{/if}
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
2024-06-11 04:29:09 +08:00
|
|
|
{#if (params?.top_k ?? null) !== null}
|
2024-02-05 17:58:54 +08:00
|
|
|
<div class="flex mt-0.5 space-x-2">
|
|
|
|
<div class=" flex-1">
|
|
|
|
<input
|
|
|
|
id="steps-range"
|
|
|
|
type="range"
|
|
|
|
min="0"
|
|
|
|
max="100"
|
|
|
|
step="0.5"
|
2024-05-25 11:29:13 +08:00
|
|
|
bind:value={params.top_k}
|
2024-02-05 17:58:54 +08:00
|
|
|
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<input
|
2024-05-25 11:29:13 +08:00
|
|
|
bind:value={params.top_k}
|
2024-02-05 17:58:54 +08:00
|
|
|
type="number"
|
|
|
|
class=" bg-transparent text-center w-14"
|
|
|
|
min="0"
|
|
|
|
max="100"
|
2024-06-11 04:41:13 +08:00
|
|
|
step="any"
|
2024-02-05 17:58:54 +08:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class=" py-0.5 w-full justify-between">
|
|
|
|
<div class="flex w-full justify-between">
|
2024-03-03 04:38:51 +08:00
|
|
|
<div class=" self-center text-xs font-medium">{$i18n.t('Top P')}</div>
|
2024-02-05 17:58:54 +08:00
|
|
|
|
|
|
|
<button
|
2024-07-09 10:26:31 +08:00
|
|
|
class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
|
2024-02-05 17:58:54 +08:00
|
|
|
type="button"
|
|
|
|
on:click={() => {
|
2024-06-11 04:29:09 +08:00
|
|
|
params.top_p = (params?.top_p ?? null) === null ? 0.9 : null;
|
2024-02-05 17:58:54 +08:00
|
|
|
}}
|
|
|
|
>
|
2024-06-11 04:29:09 +08:00
|
|
|
{#if (params?.top_p ?? null) === null}
|
2024-03-03 19:22:29 +08:00
|
|
|
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
|
2024-02-05 17:58:54 +08:00
|
|
|
{:else}
|
2024-05-25 11:29:13 +08:00
|
|
|
<span class="ml-2 self-center">{$i18n.t('Custom')}</span>
|
2024-02-05 17:58:54 +08:00
|
|
|
{/if}
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
2024-06-11 04:29:09 +08:00
|
|
|
{#if (params?.top_p ?? null) !== null}
|
2024-02-05 17:58:54 +08:00
|
|
|
<div class="flex mt-0.5 space-x-2">
|
|
|
|
<div class=" flex-1">
|
|
|
|
<input
|
|
|
|
id="steps-range"
|
|
|
|
type="range"
|
|
|
|
min="0"
|
|
|
|
max="1"
|
|
|
|
step="0.05"
|
2024-05-25 11:29:13 +08:00
|
|
|
bind:value={params.top_p}
|
2024-02-05 17:58:54 +08:00
|
|
|
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<input
|
2024-05-25 11:29:13 +08:00
|
|
|
bind:value={params.top_p}
|
2024-02-05 17:58:54 +08:00
|
|
|
type="number"
|
|
|
|
class=" bg-transparent text-center w-14"
|
|
|
|
min="0"
|
|
|
|
max="1"
|
2024-06-11 04:41:13 +08:00
|
|
|
step="any"
|
2024-02-05 17:58:54 +08:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
|
2024-08-03 00:10:12 +08:00
|
|
|
<div class=" py-0.5 w-full justify-between">
|
|
|
|
<div class="flex w-full justify-between">
|
|
|
|
<div class=" self-center text-xs font-medium">{$i18n.t('Min P')}</div>
|
|
|
|
|
|
|
|
<button
|
|
|
|
class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
|
|
|
|
type="button"
|
|
|
|
on:click={() => {
|
|
|
|
params.min_p = (params?.min_p ?? null) === null ? 0.0 : null;
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{#if (params?.min_p ?? 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>
|
|
|
|
|
|
|
|
{#if (params?.min_p ?? null) !== null}
|
|
|
|
<div class="flex mt-0.5 space-x-2">
|
|
|
|
<div class=" flex-1">
|
|
|
|
<input
|
|
|
|
id="steps-range"
|
|
|
|
type="range"
|
|
|
|
min="0"
|
|
|
|
max="1"
|
|
|
|
step="0.05"
|
|
|
|
bind:value={params.min_p}
|
|
|
|
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<input
|
|
|
|
bind:value={params.min_p}
|
|
|
|
type="number"
|
|
|
|
class=" bg-transparent text-center w-14"
|
|
|
|
min="0"
|
|
|
|
max="1"
|
|
|
|
step="any"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
|
2024-02-05 17:58:54 +08:00
|
|
|
<div class=" py-0.5 w-full justify-between">
|
|
|
|
<div class="flex w-full justify-between">
|
2024-06-02 04:46:14 +08:00
|
|
|
<div class=" self-center text-xs font-medium">{$i18n.t('Frequency Penalty')}</div>
|
2024-02-05 17:58:54 +08:00
|
|
|
|
|
|
|
<button
|
2024-07-09 10:26:31 +08:00
|
|
|
class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
|
2024-02-05 17:58:54 +08:00
|
|
|
type="button"
|
|
|
|
on:click={() => {
|
2024-06-11 04:29:09 +08:00
|
|
|
params.frequency_penalty = (params?.frequency_penalty ?? null) === null ? 1.1 : null;
|
2024-02-05 17:58:54 +08:00
|
|
|
}}
|
|
|
|
>
|
2024-06-11 04:29:09 +08:00
|
|
|
{#if (params?.frequency_penalty ?? null) === null}
|
2024-03-03 19:22:29 +08:00
|
|
|
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
|
2024-02-05 17:58:54 +08:00
|
|
|
{:else}
|
2024-05-25 11:29:13 +08:00
|
|
|
<span class="ml-2 self-center">{$i18n.t('Custom')}</span>
|
2024-02-05 17:58:54 +08:00
|
|
|
{/if}
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
2024-06-11 04:29:09 +08:00
|
|
|
{#if (params?.frequency_penalty ?? null) !== null}
|
2024-02-05 17:58:54 +08:00
|
|
|
<div class="flex mt-0.5 space-x-2">
|
|
|
|
<div class=" flex-1">
|
|
|
|
<input
|
|
|
|
id="steps-range"
|
|
|
|
type="range"
|
|
|
|
min="0"
|
|
|
|
max="2"
|
|
|
|
step="0.05"
|
2024-05-25 17:04:47 +08:00
|
|
|
bind:value={params.frequency_penalty}
|
2024-02-05 17:58:54 +08:00
|
|
|
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<input
|
2024-05-25 17:04:47 +08:00
|
|
|
bind:value={params.frequency_penalty}
|
2024-02-05 17:58:54 +08:00
|
|
|
type="number"
|
|
|
|
class=" bg-transparent text-center w-14"
|
|
|
|
min="0"
|
|
|
|
max="2"
|
2024-06-11 04:41:13 +08:00
|
|
|
step="any"
|
2024-02-05 17:58:54 +08:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class=" py-0.5 w-full justify-between">
|
|
|
|
<div class="flex w-full justify-between">
|
2024-03-03 04:38:51 +08:00
|
|
|
<div class=" self-center text-xs font-medium">{$i18n.t('Repeat Last N')}</div>
|
2024-02-05 17:58:54 +08:00
|
|
|
|
|
|
|
<button
|
2024-07-09 10:26:31 +08:00
|
|
|
class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
|
2024-02-05 17:58:54 +08:00
|
|
|
type="button"
|
|
|
|
on:click={() => {
|
2024-06-11 04:29:09 +08:00
|
|
|
params.repeat_last_n = (params?.repeat_last_n ?? null) === null ? 64 : null;
|
2024-02-05 17:58:54 +08:00
|
|
|
}}
|
|
|
|
>
|
2024-06-11 04:29:09 +08:00
|
|
|
{#if (params?.repeat_last_n ?? null) === null}
|
2024-03-03 19:22:29 +08:00
|
|
|
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
|
2024-02-05 17:58:54 +08:00
|
|
|
{:else}
|
2024-05-25 11:29:13 +08:00
|
|
|
<span class="ml-2 self-center">{$i18n.t('Custom')}</span>
|
2024-02-05 17:58:54 +08:00
|
|
|
{/if}
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
2024-06-11 04:29:09 +08:00
|
|
|
{#if (params?.repeat_last_n ?? null) !== null}
|
2024-02-05 17:58:54 +08:00
|
|
|
<div class="flex mt-0.5 space-x-2">
|
|
|
|
<div class=" flex-1">
|
|
|
|
<input
|
|
|
|
id="steps-range"
|
|
|
|
type="range"
|
|
|
|
min="-1"
|
|
|
|
max="128"
|
|
|
|
step="1"
|
2024-05-25 11:29:13 +08:00
|
|
|
bind:value={params.repeat_last_n}
|
2024-02-05 17:58:54 +08:00
|
|
|
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<input
|
2024-05-25 11:29:13 +08:00
|
|
|
bind:value={params.repeat_last_n}
|
2024-02-05 17:58:54 +08:00
|
|
|
type="number"
|
|
|
|
class=" bg-transparent text-center w-14"
|
|
|
|
min="-1"
|
|
|
|
max="128"
|
|
|
|
step="1"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class=" py-0.5 w-full justify-between">
|
|
|
|
<div class="flex w-full justify-between">
|
2024-03-03 04:38:51 +08:00
|
|
|
<div class=" self-center text-xs font-medium">{$i18n.t('Tfs Z')}</div>
|
2024-02-05 17:58:54 +08:00
|
|
|
|
|
|
|
<button
|
2024-07-09 10:26:31 +08:00
|
|
|
class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
|
2024-02-05 17:58:54 +08:00
|
|
|
type="button"
|
|
|
|
on:click={() => {
|
2024-06-11 04:29:09 +08:00
|
|
|
params.tfs_z = (params?.tfs_z ?? null) === null ? 1 : null;
|
2024-02-05 17:58:54 +08:00
|
|
|
}}
|
|
|
|
>
|
2024-06-11 04:29:09 +08:00
|
|
|
{#if (params?.tfs_z ?? null) === null}
|
2024-03-03 19:22:29 +08:00
|
|
|
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
|
2024-02-05 17:58:54 +08:00
|
|
|
{:else}
|
2024-05-25 11:29:13 +08:00
|
|
|
<span class="ml-2 self-center">{$i18n.t('Custom')}</span>
|
2024-02-05 17:58:54 +08:00
|
|
|
{/if}
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
2024-06-11 04:29:09 +08:00
|
|
|
{#if (params?.tfs_z ?? null) !== null}
|
2024-02-05 17:58:54 +08:00
|
|
|
<div class="flex mt-0.5 space-x-2">
|
|
|
|
<div class=" flex-1">
|
|
|
|
<input
|
|
|
|
id="steps-range"
|
|
|
|
type="range"
|
|
|
|
min="0"
|
|
|
|
max="2"
|
|
|
|
step="0.05"
|
2024-05-25 11:29:13 +08:00
|
|
|
bind:value={params.tfs_z}
|
2024-02-05 17:58:54 +08:00
|
|
|
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<input
|
2024-05-25 11:29:13 +08:00
|
|
|
bind:value={params.tfs_z}
|
2024-02-05 17:58:54 +08:00
|
|
|
type="number"
|
|
|
|
class=" bg-transparent text-center w-14"
|
|
|
|
min="0"
|
|
|
|
max="2"
|
2024-06-11 04:41:13 +08:00
|
|
|
step="any"
|
2024-02-05 17:58:54 +08:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class=" py-0.5 w-full justify-between">
|
|
|
|
<div class="flex w-full justify-between">
|
2024-03-03 04:38:51 +08:00
|
|
|
<div class=" self-center text-xs font-medium">{$i18n.t('Context Length')}</div>
|
2024-02-05 17:58:54 +08:00
|
|
|
|
|
|
|
<button
|
2024-07-09 10:26:31 +08:00
|
|
|
class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
|
2024-02-05 17:58:54 +08:00
|
|
|
type="button"
|
|
|
|
on:click={() => {
|
2024-06-11 04:29:09 +08:00
|
|
|
params.num_ctx = (params?.num_ctx ?? null) === null ? 2048 : null;
|
2024-02-05 17:58:54 +08:00
|
|
|
}}
|
|
|
|
>
|
2024-06-11 04:29:09 +08:00
|
|
|
{#if (params?.num_ctx ?? null) === null}
|
2024-03-03 19:22:29 +08:00
|
|
|
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
|
2024-02-05 17:58:54 +08:00
|
|
|
{:else}
|
2024-05-25 11:29:13 +08:00
|
|
|
<span class="ml-2 self-center">{$i18n.t('Custom')}</span>
|
2024-02-05 17:58:54 +08:00
|
|
|
{/if}
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
2024-06-11 04:29:09 +08:00
|
|
|
{#if (params?.num_ctx ?? null) !== null}
|
2024-02-05 17:58:54 +08:00
|
|
|
<div class="flex mt-0.5 space-x-2">
|
|
|
|
<div class=" flex-1">
|
|
|
|
<input
|
|
|
|
id="steps-range"
|
|
|
|
type="range"
|
2024-04-29 15:36:09 +08:00
|
|
|
min="-1"
|
2024-04-30 07:10:57 +08:00
|
|
|
max="10240000"
|
2024-02-05 17:58:54 +08:00
|
|
|
step="1"
|
2024-05-25 11:29:13 +08:00
|
|
|
bind:value={params.num_ctx}
|
2024-02-05 17:58:54 +08:00
|
|
|
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div class="">
|
|
|
|
<input
|
2024-05-25 11:29:13 +08:00
|
|
|
bind:value={params.num_ctx}
|
2024-02-05 17:58:54 +08:00
|
|
|
type="number"
|
|
|
|
class=" bg-transparent text-center w-14"
|
2024-04-29 15:36:09 +08:00
|
|
|
min="-1"
|
2024-06-09 11:09:59 +08:00
|
|
|
step="1"
|
2024-02-05 17:58:54 +08:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
</div>
|
2024-06-03 04:20:38 +08:00
|
|
|
|
2024-06-14 13:31:26 +08:00
|
|
|
<div class=" py-0.5 w-full justify-between">
|
|
|
|
<div class="flex w-full justify-between">
|
|
|
|
<div class=" self-center text-xs font-medium">{$i18n.t('Batch Size (num_batch)')}</div>
|
|
|
|
|
|
|
|
<button
|
2024-07-09 10:26:31 +08:00
|
|
|
class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
|
2024-06-14 13:31:26 +08:00
|
|
|
type="button"
|
|
|
|
on:click={() => {
|
|
|
|
params.num_batch = (params?.num_batch ?? null) === null ? 512 : null;
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{#if (params?.num_batch ?? 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>
|
|
|
|
|
|
|
|
{#if (params?.num_batch ?? null) !== null}
|
|
|
|
<div class="flex mt-0.5 space-x-2">
|
|
|
|
<div class=" flex-1">
|
|
|
|
<input
|
|
|
|
id="steps-range"
|
|
|
|
type="range"
|
|
|
|
min="256"
|
|
|
|
max="8192"
|
|
|
|
step="256"
|
|
|
|
bind:value={params.num_batch}
|
|
|
|
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div class="">
|
|
|
|
<input
|
|
|
|
bind:value={params.num_batch}
|
|
|
|
type="number"
|
|
|
|
class=" bg-transparent text-center w-14"
|
|
|
|
min="256"
|
|
|
|
step="256"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class=" py-0.5 w-full justify-between">
|
|
|
|
<div class="flex w-full justify-between">
|
|
|
|
<div class=" self-center text-xs font-medium">
|
|
|
|
{$i18n.t('Tokens To Keep On Context Refresh (num_keep)')}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<button
|
2024-07-09 10:26:31 +08:00
|
|
|
class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
|
2024-06-14 13:31:26 +08:00
|
|
|
type="button"
|
|
|
|
on:click={() => {
|
|
|
|
params.num_keep = (params?.num_keep ?? null) === null ? 24 : null;
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{#if (params?.num_keep ?? 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>
|
|
|
|
|
|
|
|
{#if (params?.num_keep ?? null) !== null}
|
|
|
|
<div class="flex mt-0.5 space-x-2">
|
|
|
|
<div class=" flex-1">
|
|
|
|
<input
|
|
|
|
id="steps-range"
|
|
|
|
type="range"
|
|
|
|
min="-1"
|
|
|
|
max="10240000"
|
|
|
|
step="1"
|
|
|
|
bind:value={params.num_keep}
|
|
|
|
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div class="">
|
|
|
|
<input
|
|
|
|
bind:value={params.num_keep}
|
|
|
|
type="number"
|
|
|
|
class=" bg-transparent text-center w-14"
|
|
|
|
min="-1"
|
|
|
|
step="1"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
|
2024-02-05 17:58:54 +08:00
|
|
|
<div class=" py-0.5 w-full justify-between">
|
|
|
|
<div class="flex w-full justify-between">
|
2024-05-25 15:58:20 +08:00
|
|
|
<div class=" self-center text-xs font-medium">{$i18n.t('Max Tokens (num_predict)')}</div>
|
2024-02-05 17:58:54 +08:00
|
|
|
|
|
|
|
<button
|
2024-07-09 10:26:31 +08:00
|
|
|
class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
|
2024-02-05 17:58:54 +08:00
|
|
|
type="button"
|
|
|
|
on:click={() => {
|
2024-06-11 04:29:09 +08:00
|
|
|
params.max_tokens = (params?.max_tokens ?? null) === null ? 128 : null;
|
2024-02-05 17:58:54 +08:00
|
|
|
}}
|
|
|
|
>
|
2024-06-11 04:29:09 +08:00
|
|
|
{#if (params?.max_tokens ?? null) === null}
|
2024-03-03 19:22:29 +08:00
|
|
|
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
|
2024-02-05 17:58:54 +08:00
|
|
|
{:else}
|
2024-05-25 11:29:13 +08:00
|
|
|
<span class="ml-2 self-center">{$i18n.t('Custom')}</span>
|
2024-02-05 17:58:54 +08:00
|
|
|
{/if}
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
2024-06-11 04:29:09 +08:00
|
|
|
{#if (params?.max_tokens ?? null) !== null}
|
2024-02-05 17:58:54 +08:00
|
|
|
<div class="flex mt-0.5 space-x-2">
|
|
|
|
<div class=" flex-1">
|
|
|
|
<input
|
|
|
|
id="steps-range"
|
|
|
|
type="range"
|
|
|
|
min="-2"
|
2024-09-22 12:11:59 +08:00
|
|
|
max="131072"
|
2024-02-05 17:58:54 +08:00
|
|
|
step="1"
|
2024-05-25 15:58:20 +08:00
|
|
|
bind:value={params.max_tokens}
|
2024-02-05 17:58:54 +08:00
|
|
|
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div class="">
|
|
|
|
<input
|
2024-05-25 15:58:20 +08:00
|
|
|
bind:value={params.max_tokens}
|
2024-02-05 17:58:54 +08:00
|
|
|
type="number"
|
|
|
|
class=" bg-transparent text-center w-14"
|
|
|
|
min="-2"
|
|
|
|
step="1"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
</div>
|
2024-06-03 04:20:38 +08:00
|
|
|
|
2024-06-11 04:29:09 +08:00
|
|
|
{#if admin}
|
|
|
|
<div class=" py-0.5 w-full justify-between">
|
|
|
|
<div class="flex w-full justify-between">
|
|
|
|
<div class=" self-center text-xs font-medium">{$i18n.t('use_mmap (Ollama)')}</div>
|
|
|
|
|
|
|
|
<button
|
2024-07-09 10:26:31 +08:00
|
|
|
class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
|
2024-06-11 04:29:09 +08:00
|
|
|
type="button"
|
|
|
|
on:click={() => {
|
|
|
|
params.use_mmap = (params?.use_mmap ?? null) === null ? true : null;
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{#if (params?.use_mmap ?? null) === null}
|
|
|
|
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
|
|
|
|
{:else}
|
2024-07-16 21:15:06 +08:00
|
|
|
<span class="ml-2 self-center">{$i18n.t('Custom')}</span>
|
2024-06-11 04:29:09 +08:00
|
|
|
{/if}
|
|
|
|
</button>
|
|
|
|
</div>
|
2024-07-16 21:15:06 +08:00
|
|
|
|
|
|
|
{#if (params?.use_mmap ?? null) !== null}
|
|
|
|
<div class="flex justify-between items-center mt-1">
|
|
|
|
<div class="text-xs text-gray-500">
|
|
|
|
{params.use_mmap ? 'Enabled' : 'Disabled'}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class=" pr-2">
|
|
|
|
<Switch bind:state={params.use_mmap} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/if}
|
2024-06-03 04:20:38 +08:00
|
|
|
</div>
|
|
|
|
|
2024-06-11 04:29:09 +08:00
|
|
|
<div class=" py-0.5 w-full justify-between">
|
|
|
|
<div class="flex w-full justify-between">
|
|
|
|
<div class=" self-center text-xs font-medium">{$i18n.t('use_mlock (Ollama)')}</div>
|
|
|
|
|
|
|
|
<button
|
2024-07-09 10:26:31 +08:00
|
|
|
class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
|
2024-06-11 04:29:09 +08:00
|
|
|
type="button"
|
|
|
|
on:click={() => {
|
|
|
|
params.use_mlock = (params?.use_mlock ?? null) === null ? true : null;
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{#if (params?.use_mlock ?? null) === null}
|
|
|
|
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
|
|
|
|
{:else}
|
2024-07-16 21:15:06 +08:00
|
|
|
<span class="ml-2 self-center">{$i18n.t('Custom')}</span>
|
2024-06-11 04:29:09 +08:00
|
|
|
{/if}
|
|
|
|
</button>
|
|
|
|
</div>
|
2024-07-16 21:15:06 +08:00
|
|
|
|
|
|
|
{#if (params?.use_mlock ?? null) !== null}
|
|
|
|
<div class="flex justify-between items-center mt-1">
|
|
|
|
<div class="text-xs text-gray-500">
|
|
|
|
{params.use_mlock ? 'Enabled' : 'Disabled'}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class=" pr-2">
|
|
|
|
<Switch bind:state={params.use_mlock} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/if}
|
2024-06-03 04:20:38 +08:00
|
|
|
</div>
|
|
|
|
|
2024-06-11 04:29:09 +08:00
|
|
|
<div class=" py-0.5 w-full justify-between">
|
|
|
|
<div class="flex w-full justify-between">
|
|
|
|
<div class=" self-center text-xs font-medium">{$i18n.t('num_thread (Ollama)')}</div>
|
|
|
|
|
|
|
|
<button
|
2024-07-09 10:26:31 +08:00
|
|
|
class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
|
2024-06-11 04:29:09 +08:00
|
|
|
type="button"
|
|
|
|
on:click={() => {
|
|
|
|
params.num_thread = (params?.num_thread ?? null) === null ? 2 : null;
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{#if (params?.num_thread ?? 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>
|
2024-06-03 04:20:38 +08:00
|
|
|
|
2024-06-11 04:29:09 +08:00
|
|
|
{#if (params?.num_thread ?? null) !== null}
|
|
|
|
<div class="flex mt-0.5 space-x-2">
|
|
|
|
<div class=" flex-1">
|
|
|
|
<input
|
|
|
|
id="steps-range"
|
|
|
|
type="range"
|
|
|
|
min="1"
|
|
|
|
max="256"
|
|
|
|
step="1"
|
|
|
|
bind:value={params.num_thread}
|
|
|
|
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div class="">
|
|
|
|
<input
|
|
|
|
bind:value={params.num_thread}
|
|
|
|
type="number"
|
|
|
|
class=" bg-transparent text-center w-14"
|
|
|
|
min="1"
|
|
|
|
max="256"
|
|
|
|
step="1"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/if}
|
2024-06-03 04:20:38 +08:00
|
|
|
</div>
|
|
|
|
|
2024-08-13 09:46:38 +08:00
|
|
|
<div class=" py-0.5 w-full justify-between">
|
|
|
|
<div class="flex w-full justify-between">
|
|
|
|
<div class=" self-center text-xs font-medium">{$i18n.t('num_gpu (Ollama)')}</div>
|
|
|
|
|
|
|
|
<button
|
|
|
|
class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
|
|
|
|
type="button"
|
|
|
|
on:click={() => {
|
|
|
|
params.num_gpu = (params?.num_gpu ?? null) === null ? 0 : null;
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{#if (params?.num_gpu ?? 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>
|
|
|
|
|
|
|
|
{#if (params?.num_gpu ?? null) !== null}
|
|
|
|
<div class="flex mt-0.5 space-x-2">
|
|
|
|
<div class=" flex-1">
|
|
|
|
<input
|
|
|
|
id="steps-range"
|
|
|
|
type="range"
|
|
|
|
min="0"
|
|
|
|
max="256"
|
|
|
|
step="1"
|
|
|
|
bind:value={params.num_gpu}
|
|
|
|
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div class="">
|
|
|
|
<input
|
|
|
|
bind:value={params.num_gpu}
|
|
|
|
type="number"
|
|
|
|
class=" bg-transparent text-center w-14"
|
|
|
|
min="0"
|
|
|
|
max="256"
|
|
|
|
step="1"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
|
2024-06-11 04:29:09 +08:00
|
|
|
<!-- <div class=" py-0.5 w-full justify-between">
|
|
|
|
<div class="flex w-full justify-between">
|
|
|
|
<div class=" self-center text-xs font-medium">{$i18n.t('Template')}</div>
|
|
|
|
|
|
|
|
<button
|
2024-07-09 10:26:31 +08:00
|
|
|
class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
|
2024-06-11 04:29:09 +08:00
|
|
|
type="button"
|
|
|
|
on:click={() => {
|
|
|
|
params.template = (params?.template ?? null) === null ? '' : null;
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{#if (params?.template ?? 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>
|
2024-06-03 04:20:38 +08:00
|
|
|
</div>
|
|
|
|
|
2024-06-11 04:29:09 +08:00
|
|
|
{#if (params?.template ?? null) !== null}
|
|
|
|
<div class="flex mt-0.5 space-x-2">
|
|
|
|
<div class=" flex-1">
|
|
|
|
<textarea
|
|
|
|
class="px-3 py-1.5 text-sm w-full bg-transparent border dark:border-gray-600 outline-none rounded-lg -mb-1"
|
|
|
|
placeholder="Write your model template content here"
|
|
|
|
rows="4"
|
|
|
|
bind:value={params.template}
|
|
|
|
/>
|
|
|
|
</div>
|
2024-05-25 11:29:13 +08:00
|
|
|
</div>
|
2024-06-11 04:29:09 +08:00
|
|
|
{/if}
|
|
|
|
</div> -->
|
|
|
|
{/if}
|
2024-02-05 17:58:54 +08:00
|
|
|
</div>
|