From cd9f0135f6aeac0e862f9694bd58306f39b56f6d Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Mon, 5 Feb 2024 01:58:54 -0800 Subject: [PATCH] refac: settings --- src/lib/components/chat/Settings/About.svelte | 63 + .../components/chat/Settings/AddOns.svelte | 249 +++ .../components/chat/Settings/Advanced.svelte | 626 +----- .../Settings/Advanced/AdvancedParams.svelte | 556 +++++ src/lib/components/chat/Settings/Chats.svelte | 353 ++++ .../components/chat/Settings/External.svelte | 86 + .../components/chat/Settings/General.svelte | 224 ++ .../components/chat/Settings/Interface.svelte | 118 ++ .../components/chat/Settings/Models.svelte | 596 ++++++ src/lib/components/chat/SettingsModal.svelte | 1829 +---------------- .../(app)/modelfiles/create/+page.svelte | 4 +- src/routes/(app)/modelfiles/edit/+page.svelte | 2 +- 12 files changed, 2381 insertions(+), 2325 deletions(-) create mode 100644 src/lib/components/chat/Settings/About.svelte create mode 100644 src/lib/components/chat/Settings/AddOns.svelte create mode 100644 src/lib/components/chat/Settings/Advanced/AdvancedParams.svelte create mode 100644 src/lib/components/chat/Settings/Chats.svelte create mode 100644 src/lib/components/chat/Settings/External.svelte create mode 100644 src/lib/components/chat/Settings/General.svelte create mode 100644 src/lib/components/chat/Settings/Interface.svelte create mode 100644 src/lib/components/chat/Settings/Models.svelte diff --git a/src/lib/components/chat/Settings/About.svelte b/src/lib/components/chat/Settings/About.svelte new file mode 100644 index 00000000..71cbf574 --- /dev/null +++ b/src/lib/components/chat/Settings/About.svelte @@ -0,0 +1,63 @@ + + +
+
+
+
Ollama Web UI Version
+
+
+ {$config && $config.version ? $config.version : WEB_UI_VERSION} +
+
+
+ +
+ +
+
Ollama Version
+
+
+ {ollamaVersion ?? 'N/A'} +
+
+
+ +
+ +
+ + Discord + + + + Github Repo + +
+ +
+ Created by Timothy J. Baek +
+
+
diff --git a/src/lib/components/chat/Settings/AddOns.svelte b/src/lib/components/chat/Settings/AddOns.svelte new file mode 100644 index 00000000..519faf0c --- /dev/null +++ b/src/lib/components/chat/Settings/AddOns.svelte @@ -0,0 +1,249 @@ + + +
{ + saveSettings({ + speakVoice: speakVoice !== '' ? speakVoice : undefined + }); + dispatch('save'); + }} +> +
+
+
WebUI Add-ons
+ +
+
+
Title Auto-Generation
+ + +
+
+ +
+
+
Voice Input Auto-Send
+ + +
+
+ +
+
+
Response AutoCopy to Clipboard
+ + +
+
+
+ +
+ +
+
Set Title Auto-Generation Model
+
+
+ +
+ +
+
+ +
+ +
+
+
Set Default Voice
+
+
+ +
+
+
+
+ + +
+ +
+ +
+
diff --git a/src/lib/components/chat/Settings/Advanced.svelte b/src/lib/components/chat/Settings/Advanced.svelte index 5c70dc56..5396947b 100644 --- a/src/lib/components/chat/Settings/Advanced.svelte +++ b/src/lib/components/chat/Settings/Advanced.svelte @@ -1,8 +1,15 @@ -
-
-
-
Seed
-
- +
+
+
Parameters
+ + +
+ +
+
+
Request Mode
+ +
-
-
-
Stop Sequence
-
- -
-
-
+
+ -
- - {#if options.temperature !== ''} -
-
- -
-
- -
-
- {/if} -
- -
-
-
Mirostat
- - -
- - {#if options.mirostat !== ''} -
-
- -
-
- -
-
- {/if} -
- -
-
-
Mirostat Eta
- - -
- - {#if options.mirostat_eta !== ''} -
-
- -
-
- -
-
- {/if} -
- -
-
-
Mirostat Tau
- - -
- - {#if options.mirostat_tau !== ''} -
-
- -
-
- -
-
- {/if} -
- -
-
-
Top K
- - -
- - {#if options.top_k !== ''} -
-
- -
-
- -
-
- {/if} -
- -
-
-
Top P
- - -
- - {#if options.top_p !== ''} -
-
- -
-
- -
-
- {/if} -
- -
-
-
Repeat Penalty
- - -
- - {#if options.repeat_penalty !== ''} -
-
- -
-
- -
-
- {/if} -
- -
-
-
Repeat Last N
- - -
- - {#if options.repeat_last_n !== ''} -
-
- -
-
- -
-
- {/if} -
- -
-
-
Tfs Z
- - -
- - {#if options.tfs_z !== ''} -
-
- -
-
- -
-
- {/if} -
- -
-
-
Context Length
- - -
- - {#if options.num_ctx !== ''} -
-
- -
-
- -
-
- {/if} -
-
-
-
Max Tokens
- - -
- - {#if options.num_predict !== ''} -
-
- -
-
- -
-
- {/if} + dispatch('save'); + }} + > + Save +
diff --git a/src/lib/components/chat/Settings/Advanced/AdvancedParams.svelte b/src/lib/components/chat/Settings/Advanced/AdvancedParams.svelte new file mode 100644 index 00000000..5c70dc56 --- /dev/null +++ b/src/lib/components/chat/Settings/Advanced/AdvancedParams.svelte @@ -0,0 +1,556 @@ + + +
+
+
+
Seed
+
+ +
+
+
+ +
+
+
Stop Sequence
+
+ +
+
+
+ +
+
+
Temperature
+ + +
+ + {#if options.temperature !== ''} +
+
+ +
+
+ +
+
+ {/if} +
+ +
+
+
Mirostat
+ + +
+ + {#if options.mirostat !== ''} +
+
+ +
+
+ +
+
+ {/if} +
+ +
+
+
Mirostat Eta
+ + +
+ + {#if options.mirostat_eta !== ''} +
+
+ +
+
+ +
+
+ {/if} +
+ +
+
+
Mirostat Tau
+ + +
+ + {#if options.mirostat_tau !== ''} +
+
+ +
+
+ +
+
+ {/if} +
+ +
+
+
Top K
+ + +
+ + {#if options.top_k !== ''} +
+
+ +
+
+ +
+
+ {/if} +
+ +
+
+
Top P
+ + +
+ + {#if options.top_p !== ''} +
+
+ +
+
+ +
+
+ {/if} +
+ +
+
+
Repeat Penalty
+ + +
+ + {#if options.repeat_penalty !== ''} +
+
+ +
+
+ +
+
+ {/if} +
+ +
+
+
Repeat Last N
+ + +
+ + {#if options.repeat_last_n !== ''} +
+
+ +
+
+ +
+
+ {/if} +
+ +
+
+
Tfs Z
+ + +
+ + {#if options.tfs_z !== ''} +
+
+ +
+
+ +
+
+ {/if} +
+ +
+
+
Context Length
+ + +
+ + {#if options.num_ctx !== ''} +
+
+ +
+
+ +
+
+ {/if} +
+
+
+
Max Tokens
+ + +
+ + {#if options.num_predict !== ''} +
+
+ +
+
+ +
+
+ {/if} +
+
diff --git a/src/lib/components/chat/Settings/Chats.svelte b/src/lib/components/chat/Settings/Chats.svelte new file mode 100644 index 00000000..b8befb68 --- /dev/null +++ b/src/lib/components/chat/Settings/Chats.svelte @@ -0,0 +1,353 @@ + + +
+
+
+
+
Chat History
+ + +
+ +
+ This setting does not sync across browsers or devices. +
+
+ +
+ +
+ + + +
+ +
+ + {#if showDeleteConfirm} +
+
+ + + + + Are you sure? +
+ +
+ + +
+
+ {:else} + + {/if} + + {#if $user?.role === 'admin'} +
+ + + +
+ + + {/if} +
+
diff --git a/src/lib/components/chat/Settings/External.svelte b/src/lib/components/chat/Settings/External.svelte new file mode 100644 index 00000000..455370eb --- /dev/null +++ b/src/lib/components/chat/Settings/External.svelte @@ -0,0 +1,86 @@ + + +
{ + updateOpenAIHandler(); + dispatch('save'); + + // saveSettings({ + // OPENAI_API_KEY: OPENAI_API_KEY !== '' ? OPENAI_API_KEY : undefined, + // OPENAI_API_BASE_URL: OPENAI_API_BASE_URL !== '' ? OPENAI_API_BASE_URL : undefined + // }); + }} +> +
+
+
OpenAI API Key
+
+
+ +
+
+
+ Adds optional support for online models. +
+
+ +
+ +
+
OpenAI API Base URL
+
+
+ +
+
+
+ WebUI will make requests to '{OPENAI_API_BASE_URL}/chat' +
+
+
+ +
+ +
+
diff --git a/src/lib/components/chat/Settings/General.svelte b/src/lib/components/chat/Settings/General.svelte new file mode 100644 index 00000000..1aeb3802 --- /dev/null +++ b/src/lib/components/chat/Settings/General.svelte @@ -0,0 +1,224 @@ + + +
+
+
WebUI Settings
+ +
+
Theme
+
+
+ {#if theme === 'dark'} + + + + {:else if theme === 'light'} + + + + {/if} +
+ + +
+
+ +
+
+
Notification
+ + +
+
+
+ + {#if $user.role === 'admin'} +
+
+
Ollama API URL
+
+
+ +
+ +
+ +
+ Trouble accessing Ollama? + + Click here for help. + +
+
+ {/if} + +
+ +
+
System Prompt
+