Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
19ec26ab
"...git@developer.sourcefind.cn:OpenDAS/torch-scatter.git" did not exist on "e39406212b92490099cce6fb5fd7ce2da555bda7"
Commit
19ec26ab
authored
Dec 02, 2023
by
Timothy J. Baek
Browse files
feat: modelfile builder
parent
45ff3ae2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
15 deletions
+44
-15
src/routes/(app)/modelfiles/create/+page.svelte
src/routes/(app)/modelfiles/create/+page.svelte
+44
-15
No files found.
src/routes/(app)/modelfiles/create/+page.svelte
View file @
19ec26ab
...
@@ -3,18 +3,6 @@
...
@@ -3,18 +3,6 @@
import { goto } from '$app/navigation';
import { goto } from '$app/navigation';
import Advanced from '$lib/components/chat/Settings/Advanced.svelte';
import Advanced from '$lib/components/chat/Settings/Advanced.svelte';
let categories = {
Character: false,
Assistant: false,
Writing: false,
Productivity: false,
Programming: false,
'Data Analysis': false,
Lifestyle: false,
Education: false,
Business: false
};
let loading = false;
let loading = false;
let filesInputElement;
let filesInputElement;
...
@@ -27,12 +15,17 @@
...
@@ -27,12 +15,17 @@
let raw = true;
let raw = true;
let advanced = false;
let advanced = false;
// Raw Mode
let content = '';
// Builder Mode
let model = '';
let model = '';
let system = '';
let system = '';
let template = '';
let template = '';
let options = {
let options = {
// Advanced
// Advanced
seed: 0,
seed: 0,
stop: '',
temperature: '',
temperature: '',
repeat_penalty: '',
repeat_penalty: '',
repeat_last_n: '',
repeat_last_n: '',
...
@@ -41,11 +34,29 @@
...
@@ -41,11 +34,29 @@
mirostat_tau: '',
mirostat_tau: '',
top_k: '',
top_k: '',
top_p: '',
top_p: '',
stop: '',
tfs_z: '',
tfs_z: '',
num_ctx: ''
num_ctx: ''
};
};
let content = '';
$: if (!raw) {
content = `FROM ${model}
${template !== '' ? `TEMPLATE """${template}"""` : ''}
${options.seed !== 0 ? `PARAMETER seed ${options.seed}` : ''}
${options.stop !== '' ? `PARAMETER stop ${options.stop}` : ''}
${options.temperature !== '' ? `PARAMETER temperature ${options.temperature}` : ''}
${options.repeat_penalty !== '' ? `PARAMETER repeat_penalty ${options.repeat_penalty}` : ''}
${options.repeat_last_n !== '' ? `PARAMETER repeat_last_n ${options.repeat_last_n}` : ''}
${options.mirostat !== '' ? `PARAMETER mirostat ${options.mirostat}` : ''}
${options.mirostat_eta !== '' ? `PARAMETER mirostat_eta ${options.mirostat_eta}` : ''}
${options.mirostat_tau !== '' ? `PARAMETER mirostat_tau ${options.mirostat_tau}` : ''}
${options.top_k !== '' ? `PARAMETER top_k ${options.top_k}` : ''}
${options.top_p !== '' ? `PARAMETER top_p ${options.top_p}` : ''}
${options.tfs_z !== '' ? `PARAMETER tfs_z ${options.tfs_z}` : ''}
${options.num_ctx !== '' ? `PARAMETER num_ctx ${options.num_ctx}` : ''}
SYSTEM """${system}"""`.replace(/^\s*\n/gm, '');
} else {
// content = '';
}
let suggestions = [
let suggestions = [
{
{
...
@@ -53,8 +64,27 @@
...
@@ -53,8 +64,27 @@
}
}
];
];
let categories = {
Character: false,
Assistant: false,
Writing: false,
Productivity: false,
Programming: false,
'Data Analysis': false,
Lifestyle: false,
Education: false,
Business: false
};
const submitHandler = async () => {
const submitHandler = async () => {
loading = true;
loading = true;
if (Object.keys(categories).filter((category) => categories[category]).length == 0) {
toast.error(
'Uh-oh! It looks like you missed selecting a category. Please choose one to complete your modelfile.'
);
}
if (
if (
title !== '' &&
title !== '' &&
desc !== '' &&
desc !== '' &&
...
@@ -389,7 +419,6 @@
...
@@ -389,7 +419,6 @@
class="px-3 py-1.5 text-sm w-full bg-transparent outline-none border-r dark:border-gray-600"
class="px-3 py-1.5 text-sm w-full bg-transparent outline-none border-r dark:border-gray-600"
placeholder="Write a prompt suggestion (e.g. Who are you?)"
placeholder="Write a prompt suggestion (e.g. Who are you?)"
bind:value={prompt.content}
bind:value={prompt.content}
required
/>
/>
<button
<button
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment