123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853 |
- <script lang="ts">
- import Switch from '$lib/components/common/Switch.svelte';
- import { getContext, createEventDispatcher } from 'svelte';
- const dispatch = createEventDispatcher();
- const i18n = getContext('i18n');
- export let admin = false;
- export let params = {
- // Advanced
- seed: null,
- stop: null,
- temperature: null,
- frequency_penalty: null,
- repeat_last_n: null,
- mirostat: null,
- mirostat_eta: null,
- mirostat_tau: null,
- top_k: null,
- top_p: null,
- tfs_z: null,
- num_ctx: null,
- num_batch: null,
- num_keep: null,
- max_tokens: null,
- use_mmap: null,
- use_mlock: null,
- num_thread: null,
- template: null
- };
- let customFieldName = '';
- let customFieldValue = '';
- $: if (params) {
- dispatch('change', params);
- }
- </script>
- <div class=" space-y-1 text-xs">
- <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
- class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
- 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>
- </div>
- {#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>
- </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('Stop Sequence')}</div>
- <button
- class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
- 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>
- </div>
- {#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}
- </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('Temperature')}</div>
- <button
- class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
- type="button"
- on:click={() => {
- params.temperature = (params?.temperature ?? null) === null ? 0.8 : null;
- }}
- >
- {#if (params?.temperature ?? 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?.temperature ?? 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.temperature}
- class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
- />
- </div>
- <div>
- <input
- bind:value={params.temperature}
- type="number"
- class=" bg-transparent text-center w-14"
- min="0"
- max="1"
- step="any"
- />
- </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('Mirostat')}</div>
- <button
- class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
- type="button"
- on:click={() => {
- params.mirostat = (params?.mirostat ?? null) === null ? 0 : null;
- }}
- >
- {#if (params?.mirostat ?? 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?.mirostat ?? null) !== null}
- <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"
- bind:value={params.mirostat}
- class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
- />
- </div>
- <div>
- <input
- bind:value={params.mirostat}
- 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">
- <div class=" self-center text-xs font-medium">{$i18n.t('Mirostat Eta')}</div>
- <button
- class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
- type="button"
- on:click={() => {
- params.mirostat_eta = (params?.mirostat_eta ?? null) === null ? 0.1 : null;
- }}
- >
- {#if (params?.mirostat_eta ?? 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?.mirostat_eta ?? 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.mirostat_eta}
- class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
- />
- </div>
- <div>
- <input
- bind:value={params.mirostat_eta}
- type="number"
- class=" bg-transparent text-center w-14"
- min="0"
- max="1"
- step="any"
- />
- </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('Mirostat Tau')}</div>
- <button
- class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
- type="button"
- on:click={() => {
- params.mirostat_tau = (params?.mirostat_tau ?? null) === null ? 5.0 : null;
- }}
- >
- {#if (params?.mirostat_tau ?? 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?.mirostat_tau ?? null) !== null}
- <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"
- bind:value={params.mirostat_tau}
- class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
- />
- </div>
- <div>
- <input
- bind:value={params.mirostat_tau}
- type="number"
- class=" bg-transparent text-center w-14"
- min="0"
- max="10"
- step="any"
- />
- </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('Top K')}</div>
- <button
- class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
- type="button"
- on:click={() => {
- params.top_k = (params?.top_k ?? null) === null ? 40 : null;
- }}
- >
- {#if (params?.top_k ?? 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?.top_k ?? null) !== null}
- <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"
- bind:value={params.top_k}
- class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
- />
- </div>
- <div>
- <input
- bind:value={params.top_k}
- type="number"
- class=" bg-transparent text-center w-14"
- min="0"
- max="100"
- step="any"
- />
- </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('Top P')}</div>
- <button
- class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
- type="button"
- on:click={() => {
- params.top_p = (params?.top_p ?? null) === null ? 0.9 : null;
- }}
- >
- {#if (params?.top_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?.top_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.top_p}
- class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
- />
- </div>
- <div>
- <input
- bind:value={params.top_p}
- type="number"
- class=" bg-transparent text-center w-14"
- min="0"
- max="1"
- step="any"
- />
- </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('Frequency Penalty')}</div>
- <button
- class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
- type="button"
- on:click={() => {
- params.frequency_penalty = (params?.frequency_penalty ?? null) === null ? 1.1 : null;
- }}
- >
- {#if (params?.frequency_penalty ?? 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?.frequency_penalty ?? null) !== null}
- <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"
- bind:value={params.frequency_penalty}
- class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
- />
- </div>
- <div>
- <input
- bind:value={params.frequency_penalty}
- type="number"
- class=" bg-transparent text-center w-14"
- min="0"
- max="2"
- step="any"
- />
- </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('Repeat Last N')}</div>
- <button
- class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
- type="button"
- on:click={() => {
- params.repeat_last_n = (params?.repeat_last_n ?? null) === null ? 64 : null;
- }}
- >
- {#if (params?.repeat_last_n ?? 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?.repeat_last_n ?? null) !== null}
- <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"
- bind:value={params.repeat_last_n}
- class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
- />
- </div>
- <div>
- <input
- bind:value={params.repeat_last_n}
- 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">
- <div class=" self-center text-xs font-medium">{$i18n.t('Tfs Z')}</div>
- <button
- class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
- type="button"
- on:click={() => {
- params.tfs_z = (params?.tfs_z ?? null) === null ? 1 : null;
- }}
- >
- {#if (params?.tfs_z ?? 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?.tfs_z ?? null) !== null}
- <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"
- bind:value={params.tfs_z}
- class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
- />
- </div>
- <div>
- <input
- bind:value={params.tfs_z}
- type="number"
- class=" bg-transparent text-center w-14"
- min="0"
- max="2"
- step="any"
- />
- </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('Context Length')}</div>
- <button
- class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
- type="button"
- on:click={() => {
- params.num_ctx = (params?.num_ctx ?? null) === null ? 2048 : null;
- }}
- >
- {#if (params?.num_ctx ?? 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_ctx ?? 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_ctx}
- class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
- />
- </div>
- <div class="">
- <input
- bind:value={params.num_ctx}
- type="number"
- class=" bg-transparent text-center w-14"
- min="-1"
- step="1"
- />
- </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('Batch Size (num_batch)')}</div>
- <button
- class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
- 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
- class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
- 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>
- <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('Max Tokens (num_predict)')}</div>
- <button
- class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
- type="button"
- on:click={() => {
- params.max_tokens = (params?.max_tokens ?? null) === null ? 128 : null;
- }}
- >
- {#if (params?.max_tokens ?? 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?.max_tokens ?? null) !== null}
- <div class="flex mt-0.5 space-x-2">
- <div class=" flex-1">
- <input
- id="steps-range"
- type="range"
- min="-2"
- max="16000"
- step="1"
- bind:value={params.max_tokens}
- class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
- />
- </div>
- <div class="">
- <input
- bind:value={params.max_tokens}
- type="number"
- class=" bg-transparent text-center w-14"
- min="-2"
- max="16000"
- step="1"
- />
- </div>
- </div>
- {/if}
- </div>
- {#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
- class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
- 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}
- <span class="ml-2 self-center">{$i18n.t('Custom')}</span>
- {/if}
- </button>
- </div>
- {#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}
- </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('use_mlock (Ollama)')}</div>
- <button
- class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
- 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}
- <span class="ml-2 self-center">{$i18n.t('Custom')}</span>
- {/if}
- </button>
- </div>
- {#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}
- </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('num_thread (Ollama)')}</div>
- <button
- class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
- 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>
- {#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}
- </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('Template')}</div>
- <button
- class="p-1 px-3 text-xs flex rounded transition flex-shrink-0 outline-none"
- 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>
- </div>
- {#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>
- </div>
- {/if}
- </div> -->
- {/if}
- </div>
|