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
9c24c00f
Unverified
Commit
9c24c00f
authored
Dec 05, 2023
by
Timothy Jaeryang Baek
Committed by
GitHub
Dec 05, 2023
Browse files
Merge pull request #181 from ollama-webui/doc-update
feat: custom model chat styling updated
parents
597ba080
645988d4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
3 deletions
+24
-3
src/lib/components/chat/Messages.svelte
src/lib/components/chat/Messages.svelte
+15
-1
src/routes/(app)/modelfiles/+page.svelte
src/routes/(app)/modelfiles/+page.svelte
+1
-1
src/routes/(app)/modelfiles/create/+page.svelte
src/routes/(app)/modelfiles/create/+page.svelte
+8
-1
No files found.
src/lib/components/chat/Messages.svelte
View file @
9c24c00f
...
...
@@ -317,7 +317,21 @@
</div>
<div
class=
" mt-2 text-2xl text-gray-800 dark:text-gray-100 font-semibold"
>
{#if selectedModelfile}
{selectedModelfile.desc}
<span
class=
" capitalize"
>
{selectedModelfile.title}
</span>
<div
class=
"mt-0.5 text-base font-normal text-gray-600 dark:text-gray-400"
>
{selectedModelfile.desc}
</div>
{#if selectedModelfile.user}
<div
class=
"mt-0.5 text-sm font-normal text-gray-500 dark:text-gray-500"
>
By
<a
href=
"https://ollamahub.com/"
>
{selectedModelfile.user.name
? selectedModelfile.user.name
: `@${selectedModelfile.user.username}`}
</a
>
</div>
{/if}
{:else}
How can I help you today?
{/if}
...
...
src/routes/(app)/modelfiles/+page.svelte
View file @
9c24c00f
...
...
@@ -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',
...
...
src/routes/(app)/modelfiles/create/+page.svelte
View file @
9c24c00f
...
...
@@ -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;
}
...
...
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