From ea257636ee82bd8b7f1af2087e8f579ec1356c63 Mon Sep 17 00:00:00 2001 From: Anthony Cucci <47187712+AnthonyCucci@users.noreply.github.com> Date: Wed, 29 Nov 2023 22:02:51 -0500 Subject: [PATCH 1/7] Update SettingsModal.svelte Added context length --- src/lib/components/chat/SettingsModal.svelte | 24 ++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/lib/components/chat/SettingsModal.svelte b/src/lib/components/chat/SettingsModal.svelte index e6f75c7f..c070659c 100644 --- a/src/lib/components/chat/SettingsModal.svelte +++ b/src/lib/components/chat/SettingsModal.svelte @@ -30,6 +30,7 @@ let repeat_penalty = 1.1; let top_k = 40; let top_p = 0.9; + let num_ctx = 2048; // Models let modelTag = ''; @@ -231,6 +232,7 @@ repeat_penalty = settings.repeat_penalty ?? 1.1; top_k = settings.top_k ?? 40; top_p = settings.top_p ?? 0.9; + num_ctx = settings.num_ctx ?? 2048; titleAutoGenerate = settings.titleAutoGenerate ?? true; speechAutoSend = settings.speechAutoSend ?? false; @@ -732,8 +734,24 @@ class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700" /> +
+ + +
-
+ {:else if selectedTab === 'models'}
From cd22f733378ccdbff73754d98a9c3df09e3f5cfa Mon Sep 17 00:00:00 2001 From: Anthony Cucci <47187712+AnthonyCucci@users.noreply.github.com> Date: Wed, 29 Nov 2023 22:03:33 -0500 Subject: [PATCH 2/7] Update +page.svelte Added num_ctx variable --- src/routes/(app)/+page.svelte | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/routes/(app)/+page.svelte b/src/routes/(app)/+page.svelte index 14cb72ce..753e9f64 100644 --- a/src/routes/(app)/+page.svelte +++ b/src/routes/(app)/+page.svelte @@ -125,7 +125,8 @@ temperature: $settings.temperature ?? undefined, repeat_penalty: $settings.repeat_penalty ?? undefined, top_k: $settings.top_k ?? undefined, - top_p: $settings.top_p ?? undefined + top_p: $settings.top_p ?? undefined, + num_ctx: $settings.num_ctx ?? undefined }, format: $settings.requestFormat ?? undefined, context: @@ -196,7 +197,8 @@ temperature: $settings.temperature ?? undefined, repeat_penalty: $settings.repeat_penalty ?? undefined, top_k: $settings.top_k ?? undefined, - top_p: $settings.top_p ?? undefined + top_p: $settings.top_p ?? undefined, + num_ctx: $settings.num_ctx ?? undefined }, messages: messages, history: history @@ -264,6 +266,7 @@ .map((message) => ({ role: message.role, content: message.content })), temperature: $settings.temperature ?? undefined, top_p: $settings.top_p ?? undefined, + num_ctx: $settings.num_ctx ?? undefined, frequency_penalty: $settings.repeat_penalty ?? undefined }) }); @@ -323,7 +326,8 @@ temperature: $settings.temperature ?? undefined, repeat_penalty: $settings.repeat_penalty ?? undefined, top_k: $settings.top_k ?? undefined, - top_p: $settings.top_p ?? undefined + top_p: $settings.top_p ?? undefined, + num_ctx: $settings.num_ctx ?? undefined }, messages: messages, history: history @@ -386,7 +390,8 @@ temperature: $settings.temperature ?? undefined, repeat_penalty: $settings.repeat_penalty ?? undefined, top_k: $settings.top_k ?? undefined, - top_p: $settings.top_p ?? undefined + top_p: $settings.top_p ?? undefined, + num_ctx: $settings.num_ctx ?? undefined }, messages: messages, history: history From d1809432520597417a4cd4f3756051dd440bd96f Mon Sep 17 00:00:00 2001 From: Anthony Cucci <47187712+AnthonyCucci@users.noreply.github.com> Date: Wed, 29 Nov 2023 22:04:38 -0500 Subject: [PATCH 3/7] Update +page.svelte --- src/routes/(app)/c/[id]/+page.svelte | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/routes/(app)/c/[id]/+page.svelte b/src/routes/(app)/c/[id]/+page.svelte index daf0f793..e6539e8d 100644 --- a/src/routes/(app)/c/[id]/+page.svelte +++ b/src/routes/(app)/c/[id]/+page.svelte @@ -160,7 +160,8 @@ temperature: $settings.temperature ?? undefined, repeat_penalty: $settings.repeat_penalty ?? undefined, top_k: $settings.top_k ?? undefined, - top_p: $settings.top_p ?? undefined + top_p: $settings.top_p ?? undefined, + num_ctx: $settings.num_ctx ?? undefined }, format: $settings.requestFormat ?? undefined, context: @@ -231,7 +232,8 @@ temperature: $settings.temperature ?? undefined, repeat_penalty: $settings.repeat_penalty ?? undefined, top_k: $settings.top_k ?? undefined, - top_p: $settings.top_p ?? undefined + top_p: $settings.top_p ?? undefined, + num_ctx: $settings.num_ctx ?? undefined }, messages: messages, history: history @@ -299,6 +301,7 @@ .map((message) => ({ role: message.role, content: message.content })), temperature: $settings.temperature ?? undefined, top_p: $settings.top_p ?? undefined, + num_ctx: $settings.num_ctx ?? undefined, frequency_penalty: $settings.repeat_penalty ?? undefined }) }); @@ -358,7 +361,8 @@ temperature: $settings.temperature ?? undefined, repeat_penalty: $settings.repeat_penalty ?? undefined, top_k: $settings.top_k ?? undefined, - top_p: $settings.top_p ?? undefined + top_p: $settings.top_p ?? undefined, + num_ctx: $settings.num_ctx ?? undefined }, messages: messages, history: history @@ -419,7 +423,8 @@ temperature: $settings.temperature ?? undefined, repeat_penalty: $settings.repeat_penalty ?? undefined, top_k: $settings.top_k ?? undefined, - top_p: $settings.top_p ?? undefined + top_p: $settings.top_p ?? undefined, + num_ctx: $settings.num_ctx ?? undefined }, messages: messages, history: history From 467384e9d51f2e19d1abe5133525936abefdb0e4 Mon Sep 17 00:00:00 2001 From: Anthony Cucci <47187712+AnthonyCucci@users.noreply.github.com> Date: Wed, 29 Nov 2023 22:06:37 -0500 Subject: [PATCH 4/7] Update SettingsModal.svelte fixed bad , --- src/lib/components/chat/SettingsModal.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/chat/SettingsModal.svelte b/src/lib/components/chat/SettingsModal.svelte index c070659c..1cd0f34c 100644 --- a/src/lib/components/chat/SettingsModal.svelte +++ b/src/lib/components/chat/SettingsModal.svelte @@ -762,7 +762,7 @@ repeat_penalty: repeat_penalty !== 1.1 ? repeat_penalty : undefined, top_k: top_k !== 40 ? top_k : undefined, top_p: top_p !== 0.9 ? top_p : undefined, - num_ctx: num_ctx !== 2048 ? num_ctx : undefined, + num_ctx: num_ctx !== 2048 ? num_ctx : undefined }); show = false; }} From ec07dff7d033ea55ac3d5cdb74063f9d984954f2 Mon Sep 17 00:00:00 2001 From: Anthony Cucci <47187712+AnthonyCucci@users.noreply.github.com> Date: Wed, 29 Nov 2023 22:26:50 -0500 Subject: [PATCH 5/7] Update SettingsModal.svelte --- src/lib/components/chat/SettingsModal.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/chat/SettingsModal.svelte b/src/lib/components/chat/SettingsModal.svelte index 1cd0f34c..7faf989d 100644 --- a/src/lib/components/chat/SettingsModal.svelte +++ b/src/lib/components/chat/SettingsModal.svelte @@ -744,7 +744,7 @@ Date: Wed, 29 Nov 2023 19:33:30 -0800 Subject: [PATCH 6/7] fix: step value update --- src/lib/components/chat/SettingsModal.svelte | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/components/chat/SettingsModal.svelte b/src/lib/components/chat/SettingsModal.svelte index 7faf989d..4e3d4099 100644 --- a/src/lib/components/chat/SettingsModal.svelte +++ b/src/lib/components/chat/SettingsModal.svelte @@ -747,7 +747,7 @@ min="1" max="16000" bind:value={num_ctx} - step="32" + step="1" class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700" />
@@ -771,7 +771,6 @@
- {:else if selectedTab === 'models'}
From a4712989db6787e84b26eba334519a424890ca09 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Wed, 29 Nov 2023 19:58:30 -0800 Subject: [PATCH 7/7] feat: advanced settings refac --- src/lib/components/chat/SettingsModal.svelte | 367 ++++++++++++------- 1 file changed, 243 insertions(+), 124 deletions(-) diff --git a/src/lib/components/chat/SettingsModal.svelte b/src/lib/components/chat/SettingsModal.svelte index 4e3d4099..31da70fe 100644 --- a/src/lib/components/chat/SettingsModal.svelte +++ b/src/lib/components/chat/SettingsModal.svelte @@ -26,11 +26,11 @@ // Advanced let requestFormat = ''; let seed = 0; - let temperature = 0.8; - let repeat_penalty = 1.1; - let top_k = 40; - let top_p = 0.9; - let num_ctx = 2048; + let temperature = ''; + let repeat_penalty = ''; + let top_k = ''; + let top_p = ''; + let num_ctx = ''; // Models let modelTag = ''; @@ -228,11 +228,11 @@ requestFormat = settings.requestFormat ?? ''; seed = settings.seed ?? 0; - temperature = settings.temperature ?? 0.8; - repeat_penalty = settings.repeat_penalty ?? 1.1; - top_k = settings.top_k ?? 40; - top_p = settings.top_p ?? 0.9; - num_ctx = settings.num_ctx ?? 2048; + temperature = settings.temperature ?? ''; + repeat_penalty = settings.repeat_penalty ?? ''; + top_k = settings.top_k ?? ''; + top_p = settings.top_p ?? ''; + num_ctx = settings.num_ctx ?? ''; titleAutoGenerate = settings.titleAutoGenerate ?? true; speechAutoSend = settings.speechAutoSend ?? false; @@ -614,6 +614,234 @@ {:else if selectedTab === 'advanced'}
+
+
+
Seed
+
+ +
+
+
+ +
+
+
Temperature
+ + +
+ + {#if temperature !== ''} +
+
+ +
+
+ +
+
+ {/if} +
+ +
+
+
Repeat Penalty
+ + +
+ + {#if repeat_penalty !== ''} +
+
+ +
+
+ +
+
+ {/if} +
+ +
+
+
Top K
+ + +
+ + {#if top_k !== ''} +
+
+ +
+
+ +
+
+ {/if} +
+ +
+
+
Top P
+ + +
+ + {#if top_p !== ''} +
+
+ +
+
+ +
+
+ {/if} +
+ +
+
+
Context Length
+ + +
+ + {#if num_ctx !== ''} +
+
+ +
+
+ +
+
+ {/if} +
+ +
+
Request Mode
@@ -642,115 +870,6 @@
- -
- -
-
-
Seed
-
- -
-
-
- -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
-
- - -