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
06ce5aed
Commit
06ce5aed
authored
Mar 02, 2024
by
Timothy J. Baek
Browse files
fix: text completion replaced with chat completion
parent
2379e94c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
src/routes/(app)/playground/+page.svelte
src/routes/(app)/playground/+page.svelte
+11
-3
No files found.
src/routes/(app)/playground/+page.svelte
View file @
06ce5aed
...
...
@@ -8,7 +8,7 @@
import { WEBUI_API_BASE_URL } from '$lib/constants';
import { WEBUI_NAME, config, user, models } from '$lib/stores';
import { cancelChatCompletion, generate
Tex
tCompletion } from '$lib/apis/ollama';
import { cancelChatCompletion, generate
Cha
tCompletion } from '$lib/apis/ollama';
import { splitStream } from '$lib/utils';
let mode = 'complete';
...
...
@@ -44,7 +44,15 @@
if (selectedModel) {
loading = true;
const res = await generateTextCompletion(localStorage.token, selectedModel, text);
const [res, controller] = await generateChatCompletion(localStorage.token, {
model: selectedModel,
messages: [
{
role: 'assistant',
content: text
}
]
});
if (res && res.ok) {
const reader = res.body
...
...
@@ -80,7 +88,7 @@
currentRequestId = data.id;
} else {
if (data.done == false) {
text += data.
r
es
ponse
;
text += data.
m
es
sage.content
;
} else {
console.log('done');
}
...
...
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