feat: custom model chat styling updated

This commit is contained in:
Timothy J. Baek 2023-12-05 16:36:44 -08:00
parent 9b35b1fd90
commit 9de56550ab
3 changed files with 20 additions and 3 deletions

View file

@ -7,7 +7,7 @@
const deleteModelHandler = async (tagName) => {
let success = null;
const res = await fetch(`${OLLAMA_API_BASE_URL}/delete`, {
const res = await fetch(`${$settings?.API_BASE_URL ?? OLLAMA_API_BASE_URL}/delete`, {
method: 'DELETE',
headers: {
'Content-Type': 'text/event-stream',

View file

@ -52,6 +52,8 @@
num_ctx: ''
};
let modelfileCreator = null;
$: tagName = title !== '' ? `${title.replace(/\s+/g, '-').toLowerCase()}:latest` : '';
$: if (!raw) {
@ -202,7 +204,8 @@ SYSTEM """${system}"""`.replace(/^\s*\n/gm, '');
desc: desc,
content: content,
suggestionPrompts: suggestions.filter((prompt) => prompt.content !== ''),
categories: Object.keys(categories).filter((category) => categories[category])
categories: Object.keys(categories).filter((category) => categories[category]),
user: modelfileCreator !== null ? modelfileCreator : undefined
});
await goto('/modelfiles');
}
@ -237,6 +240,10 @@ SYSTEM """${system}"""`.replace(/^\s*\n/gm, '');
}
];
modelfileCreator = {
username: modelfile.user.username,
name: modelfile.user.name
};
for (const category of modelfile.categories) {
categories[category.toLowerCase()] = true;
}