forked from open-webui/open-webui
Merge pull request #165 from AnthonyCucci/main
Adding num_ctx to the model settings page
This commit is contained in:
commit
ffe18bcd6b
3 changed files with 39 additions and 10 deletions
|
@ -30,6 +30,7 @@
|
||||||
let repeat_penalty = 1.1;
|
let repeat_penalty = 1.1;
|
||||||
let top_k = 40;
|
let top_k = 40;
|
||||||
let top_p = 0.9;
|
let top_p = 0.9;
|
||||||
|
let num_ctx = 2048;
|
||||||
|
|
||||||
// Models
|
// Models
|
||||||
let modelTag = '';
|
let modelTag = '';
|
||||||
|
@ -231,6 +232,7 @@
|
||||||
repeat_penalty = settings.repeat_penalty ?? 1.1;
|
repeat_penalty = settings.repeat_penalty ?? 1.1;
|
||||||
top_k = settings.top_k ?? 40;
|
top_k = settings.top_k ?? 40;
|
||||||
top_p = settings.top_p ?? 0.9;
|
top_p = settings.top_p ?? 0.9;
|
||||||
|
num_ctx = settings.num_ctx ?? 2048;
|
||||||
|
|
||||||
titleAutoGenerate = settings.titleAutoGenerate ?? true;
|
titleAutoGenerate = settings.titleAutoGenerate ?? true;
|
||||||
speechAutoSend = settings.speechAutoSend ?? false;
|
speechAutoSend = settings.speechAutoSend ?? false;
|
||||||
|
@ -732,8 +734,24 @@
|
||||||
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
|
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<label for="steps-range" class=" mb-2 text-sm font-medium flex justify-between">
|
||||||
|
<div>Context Length</div>
|
||||||
|
<div>
|
||||||
|
{num_ctx}
|
||||||
|
</div></label
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
id="steps-range"
|
||||||
|
type="range"
|
||||||
|
min="1"
|
||||||
|
max="16000"
|
||||||
|
bind:value={num_ctx}
|
||||||
|
step="1"
|
||||||
|
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex justify-end pt-3 text-sm font-medium">
|
<div class="flex justify-end pt-3 text-sm font-medium">
|
||||||
<button
|
<button
|
||||||
class=" px-4 py-2 bg-emerald-600 hover:bg-emerald-700 text-gray-100 transition rounded"
|
class=" px-4 py-2 bg-emerald-600 hover:bg-emerald-700 text-gray-100 transition rounded"
|
||||||
|
@ -743,7 +761,8 @@
|
||||||
temperature: temperature !== 0.8 ? temperature : undefined,
|
temperature: temperature !== 0.8 ? temperature : undefined,
|
||||||
repeat_penalty: repeat_penalty !== 1.1 ? repeat_penalty : undefined,
|
repeat_penalty: repeat_penalty !== 1.1 ? repeat_penalty : undefined,
|
||||||
top_k: top_k !== 40 ? top_k : undefined,
|
top_k: top_k !== 40 ? top_k : undefined,
|
||||||
top_p: top_p !== 0.9 ? top_p : undefined
|
top_p: top_p !== 0.9 ? top_p : undefined,
|
||||||
|
num_ctx: num_ctx !== 2048 ? num_ctx : undefined
|
||||||
});
|
});
|
||||||
show = false;
|
show = false;
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -125,7 +125,8 @@
|
||||||
temperature: $settings.temperature ?? undefined,
|
temperature: $settings.temperature ?? undefined,
|
||||||
repeat_penalty: $settings.repeat_penalty ?? undefined,
|
repeat_penalty: $settings.repeat_penalty ?? undefined,
|
||||||
top_k: $settings.top_k ?? 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,
|
format: $settings.requestFormat ?? undefined,
|
||||||
context:
|
context:
|
||||||
|
@ -196,7 +197,8 @@
|
||||||
temperature: $settings.temperature ?? undefined,
|
temperature: $settings.temperature ?? undefined,
|
||||||
repeat_penalty: $settings.repeat_penalty ?? undefined,
|
repeat_penalty: $settings.repeat_penalty ?? undefined,
|
||||||
top_k: $settings.top_k ?? 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,
|
messages: messages,
|
||||||
history: history
|
history: history
|
||||||
|
@ -264,6 +266,7 @@
|
||||||
.map((message) => ({ role: message.role, content: message.content })),
|
.map((message) => ({ role: message.role, content: message.content })),
|
||||||
temperature: $settings.temperature ?? undefined,
|
temperature: $settings.temperature ?? undefined,
|
||||||
top_p: $settings.top_p ?? undefined,
|
top_p: $settings.top_p ?? undefined,
|
||||||
|
num_ctx: $settings.num_ctx ?? undefined,
|
||||||
frequency_penalty: $settings.repeat_penalty ?? undefined
|
frequency_penalty: $settings.repeat_penalty ?? undefined
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
@ -323,7 +326,8 @@
|
||||||
temperature: $settings.temperature ?? undefined,
|
temperature: $settings.temperature ?? undefined,
|
||||||
repeat_penalty: $settings.repeat_penalty ?? undefined,
|
repeat_penalty: $settings.repeat_penalty ?? undefined,
|
||||||
top_k: $settings.top_k ?? 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,
|
messages: messages,
|
||||||
history: history
|
history: history
|
||||||
|
@ -386,7 +390,8 @@
|
||||||
temperature: $settings.temperature ?? undefined,
|
temperature: $settings.temperature ?? undefined,
|
||||||
repeat_penalty: $settings.repeat_penalty ?? undefined,
|
repeat_penalty: $settings.repeat_penalty ?? undefined,
|
||||||
top_k: $settings.top_k ?? 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,
|
messages: messages,
|
||||||
history: history
|
history: history
|
||||||
|
|
|
@ -160,7 +160,8 @@
|
||||||
temperature: $settings.temperature ?? undefined,
|
temperature: $settings.temperature ?? undefined,
|
||||||
repeat_penalty: $settings.repeat_penalty ?? undefined,
|
repeat_penalty: $settings.repeat_penalty ?? undefined,
|
||||||
top_k: $settings.top_k ?? 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,
|
format: $settings.requestFormat ?? undefined,
|
||||||
context:
|
context:
|
||||||
|
@ -231,7 +232,8 @@
|
||||||
temperature: $settings.temperature ?? undefined,
|
temperature: $settings.temperature ?? undefined,
|
||||||
repeat_penalty: $settings.repeat_penalty ?? undefined,
|
repeat_penalty: $settings.repeat_penalty ?? undefined,
|
||||||
top_k: $settings.top_k ?? 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,
|
messages: messages,
|
||||||
history: history
|
history: history
|
||||||
|
@ -299,6 +301,7 @@
|
||||||
.map((message) => ({ role: message.role, content: message.content })),
|
.map((message) => ({ role: message.role, content: message.content })),
|
||||||
temperature: $settings.temperature ?? undefined,
|
temperature: $settings.temperature ?? undefined,
|
||||||
top_p: $settings.top_p ?? undefined,
|
top_p: $settings.top_p ?? undefined,
|
||||||
|
num_ctx: $settings.num_ctx ?? undefined,
|
||||||
frequency_penalty: $settings.repeat_penalty ?? undefined
|
frequency_penalty: $settings.repeat_penalty ?? undefined
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
@ -358,7 +361,8 @@
|
||||||
temperature: $settings.temperature ?? undefined,
|
temperature: $settings.temperature ?? undefined,
|
||||||
repeat_penalty: $settings.repeat_penalty ?? undefined,
|
repeat_penalty: $settings.repeat_penalty ?? undefined,
|
||||||
top_k: $settings.top_k ?? 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,
|
messages: messages,
|
||||||
history: history
|
history: history
|
||||||
|
@ -419,7 +423,8 @@
|
||||||
temperature: $settings.temperature ?? undefined,
|
temperature: $settings.temperature ?? undefined,
|
||||||
repeat_penalty: $settings.repeat_penalty ?? undefined,
|
repeat_penalty: $settings.repeat_penalty ?? undefined,
|
||||||
top_k: $settings.top_k ?? 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,
|
messages: messages,
|
||||||
history: history
|
history: history
|
||||||
|
|
Loading…
Reference in a new issue