-
{$i18n.t('use_mmap (Ollama)')}
+ {#if admin}
+
+
+
{$i18n.t('use_mmap (Ollama)')}
-
-
-
-
-
-
-
{$i18n.t('use_mlock (Ollama)')}
-
-
-
-
-
-
-
-
{$i18n.t('num_thread (Ollama)')}
-
-
-
-
- {#if (params?.num_thread ?? null) !== null}
-
- {/if}
-
-
-
-
-
{$i18n.t('Template')}
-
-
- {#if (params?.template ?? null) !== null}
-
-
-
-
+
+
+
{$i18n.t('use_mlock (Ollama)')}
+
+
- {/if}
-
+
+
+
+
+
{$i18n.t('num_thread (Ollama)')}
+
+
+
+
+ {#if (params?.num_thread ?? null) !== null}
+
+ {/if}
+
+
+
+ {/if}
diff --git a/src/lib/components/chat/Settings/General.svelte b/src/lib/components/chat/Settings/General.svelte
index 072c1fcf7..9b3e35ef5 100644
--- a/src/lib/components/chat/Settings/General.svelte
+++ b/src/lib/components/chat/Settings/General.svelte
@@ -4,7 +4,7 @@
import { getLanguages } from '$lib/i18n';
const dispatch = createEventDispatcher();
- import { models, settings, theme } from '$lib/stores';
+ import { models, settings, theme, user } from '$lib/stores';
const i18n = getContext('i18n');
@@ -43,19 +43,19 @@
let params = {
// Advanced
- seed: 0,
- temperature: '',
- frequency_penalty: '',
- repeat_last_n: '',
- mirostat: '',
- mirostat_eta: '',
- mirostat_tau: '',
- top_k: '',
- top_p: '',
+ seed: null,
+ temperature: null,
+ frequency_penalty: null,
+ repeat_last_n: null,
+ mirostat: null,
+ mirostat_eta: null,
+ mirostat_tau: null,
+ top_k: null,
+ top_p: null,
stop: null,
- tfs_z: '',
- num_ctx: '',
- max_tokens: ''
+ tfs_z: null,
+ num_ctx: null,
+ max_tokens: null
};
const toggleRequestFormat = async () => {
@@ -79,12 +79,6 @@
requestFormat = $settings.requestFormat ?? '';
keepAlive = $settings.keepAlive ?? null;
- params.seed = $settings.seed ?? 0;
- params.temperature = $settings.temperature ?? '';
- params.frequency_penalty = $settings.frequency_penalty ?? '';
- params.top_k = $settings.top_k ?? '';
- params.top_p = $settings.top_p ?? '';
- params.num_ctx = $settings.num_ctx ?? '';
params = { ...params, ...$settings.params };
params.stop = $settings?.params?.stop ? ($settings?.params?.stop ?? []).join(',') : null;
});
@@ -227,7 +221,7 @@
@@ -300,20 +294,23 @@
saveSettings({
system: system !== '' ? system : undefined,
params: {
- seed: (params.seed !== 0 ? params.seed : undefined) ?? undefined,
+ seed: (params.seed !== null ? params.seed : undefined) ?? undefined,
stop: params.stop ? params.stop.split(',').filter((e) => e) : undefined,
- temperature: params.temperature !== '' ? params.temperature : undefined,
+ temperature: params.temperature !== null ? params.temperature : undefined,
frequency_penalty:
- params.frequency_penalty !== '' ? params.frequency_penalty : undefined,
- repeat_last_n: params.repeat_last_n !== '' ? params.repeat_last_n : undefined,
- mirostat: params.mirostat !== '' ? params.mirostat : undefined,
- mirostat_eta: params.mirostat_eta !== '' ? params.mirostat_eta : undefined,
- mirostat_tau: params.mirostat_tau !== '' ? params.mirostat_tau : undefined,
- top_k: params.top_k !== '' ? params.top_k : undefined,
- top_p: params.top_p !== '' ? params.top_p : undefined,
- tfs_z: params.tfs_z !== '' ? params.tfs_z : undefined,
- num_ctx: params.num_ctx !== '' ? params.num_ctx : undefined,
- max_tokens: params.max_tokens !== '' ? params.max_tokens : undefined
+ params.frequency_penalty !== null ? params.frequency_penalty : undefined,
+ repeat_last_n: params.repeat_last_n !== null ? params.repeat_last_n : undefined,
+ mirostat: params.mirostat !== null ? params.mirostat : undefined,
+ mirostat_eta: params.mirostat_eta !== null ? params.mirostat_eta : undefined,
+ mirostat_tau: params.mirostat_tau !== null ? params.mirostat_tau : undefined,
+ top_k: params.top_k !== null ? params.top_k : undefined,
+ top_p: params.top_p !== null ? params.top_p : undefined,
+ tfs_z: params.tfs_z !== null ? params.tfs_z : undefined,
+ num_ctx: params.num_ctx !== null ? params.num_ctx : undefined,
+ max_tokens: params.max_tokens !== null ? params.max_tokens : undefined,
+ use_mmap: params.use_mmap !== null ? params.use_mmap : undefined,
+ use_mlock: params.use_mlock !== null ? params.use_mlock : undefined
+ num_thread: params.num_thread !== null ? params.num_thread : undefined
},
keepAlive: keepAlive ? (isNaN(keepAlive) ? keepAlive : parseInt(keepAlive)) : undefined
});
diff --git a/src/routes/(app)/workspace/models/create/+page.svelte b/src/routes/(app)/workspace/models/create/+page.svelte
index 2552a5763..181aafe2f 100644
--- a/src/routes/(app)/workspace/models/create/+page.svelte
+++ b/src/routes/(app)/workspace/models/create/+page.svelte
@@ -445,6 +445,7 @@
{#if showAdvanced}
{
info.params = { ...info.params, ...params };
diff --git a/src/routes/(app)/workspace/models/edit/+page.svelte b/src/routes/(app)/workspace/models/edit/+page.svelte
index 4afc5e1f3..970be7a22 100644
--- a/src/routes/(app)/workspace/models/edit/+page.svelte
+++ b/src/routes/(app)/workspace/models/edit/+page.svelte
@@ -408,6 +408,7 @@
{#if showAdvanced}
{
info.params = { ...info.params, ...params };