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
754ea162
"git@developer.sourcefind.cn:modelzoo/resnet50_tensorflow.git" did not exist on "2924510a68782462066d8b8937a0b3e4a015f871"
Commit
754ea162
authored
Jan 04, 2024
by
Timothy J. Baek
Browse files
fix: delete model issue
parent
30aff2db
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
42 deletions
+7
-42
src/lib/components/chat/SettingsModal.svelte
src/lib/components/chat/SettingsModal.svelte
+7
-42
No files found.
src/lib/components/chat/SettingsModal.svelte
View file @
754ea162
...
...
@@ -471,45 +471,12 @@
};
const deleteModelHandler = async () => {
const res = await deleteModel(localStorage.token, deleteModelTag);
const res = await deleteModel(localStorage.token, deleteModelTag).catch((error) => {
toast.error(error);
});
if (res) {
const reader = res.body
.pipeThrough(new TextDecoderStream())
.pipeThrough(splitStream('\n'))
.getReader();
while (true) {
const { value, done } = await reader.read();
if (done) break;
try {
let lines = value.split('\n');
for (const line of lines) {
if (line !== '' && line !== 'null') {
console.log(line);
let data = JSON.parse(line);
console.log(data);
if (data.error) {
throw data.error;
}
if (data.detail) {
throw data.detail;
}
if (data.status) {
}
} else {
toast.success(`Deleted ${deleteModelTag}`);
}
}
} catch (error) {
console.log(error);
toast.error(error);
}
}
toast.success(`Deleted ${deleteModelTag}`);
}
deleteModelTag = '';
...
...
@@ -1004,7 +971,7 @@
<div class="flex-1 mr-2">
<input
class="w-full rounded py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-800 outline-none"
placeholder="Enter URL (e.g. http://localhost:
8080/ollama
/api)"
placeholder="Enter URL (e.g. http://localhost:
11434
/api)"
bind:value={API_BASE_URL}
/>
</div>
...
...
@@ -1030,11 +997,9 @@
</div>
<div class="mt-2 text-xs text-gray-400 dark:text-gray-500">
The field above should be set to <span
class=" text-gray-500 dark:text-gray-300 font-medium">'/ollama/api'</span
>;
Trouble accessing Ollama?
<a
class="
text-gray-500 dark:
text-gray-300 font-medium"
class=" text-gray-300 font-medium"
href="https://github.com/ollama-webui/ollama-webui#troubleshooting"
target="_blank"
>
...
...
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