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
bfba72d4
"test/vscode:/vscode.git/clone" did not exist on "9d8f834aa31880c223e8b134e2013e3e797ce0a9"
Commit
bfba72d4
authored
Feb 24, 2024
by
Timothy J. Baek
Browse files
fix: pip dependency
parent
e8904ac3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
24 deletions
+25
-24
backend/requirements.txt
backend/requirements.txt
+1
-1
src/lib/components/chat/Settings/Connections.svelte
src/lib/components/chat/Settings/Connections.svelte
+7
-4
src/lib/components/chat/SettingsModal.svelte
src/lib/components/chat/SettingsModal.svelte
+17
-19
No files found.
backend/requirements.txt
View file @
bfba72d4
...
@@ -16,7 +16,7 @@ aiohttp
...
@@ -16,7 +16,7 @@ aiohttp
peewee
peewee
bcrypt
bcrypt
litellm
[proxy]
litellm
langchain
langchain
langchain-community
langchain-community
...
...
src/lib/components/chat/Settings/Connections.svelte
View file @
bfba72d4
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
import { createEventDispatcher, onMount } from 'svelte';
import { createEventDispatcher, onMount } from 'svelte';
const dispatch = createEventDispatcher();
const dispatch = createEventDispatcher();
import { getOllamaAPIUrl, updateOllamaAPIUrl } from '$lib/apis/ollama';
import { getOllamaAPIUrl,
getOllamaVersion,
updateOllamaAPIUrl } from '$lib/apis/ollama';
import { getOpenAIKey, getOpenAIUrl, updateOpenAIKey, updateOpenAIUrl } from '$lib/apis/openai';
import { getOpenAIKey, getOpenAIUrl, updateOpenAIKey, updateOpenAIUrl } from '$lib/apis/openai';
import toast from 'svelte-french-toast';
import toast from 'svelte-french-toast';
...
@@ -24,11 +24,14 @@
...
@@ -24,11 +24,14 @@
const updateOllamaAPIUrlHandler = async () => {
const updateOllamaAPIUrlHandler = async () => {
API_BASE_URL = await updateOllamaAPIUrl(localStorage.token, API_BASE_URL);
API_BASE_URL = await updateOllamaAPIUrl(localStorage.token, API_BASE_URL);
const _models = await getModels('ollama');
if (_models.length > 0) {
const ollamaVersion = await getOllamaVersion(localStorage.token).catch((error) => {
return null;
});
if (ollamaVersion) {
toast.success('Server connection verified');
toast.success('Server connection verified');
await models.set(
_m
odels);
await models.set(
await getM
odels
()
);
}
}
};
};
...
...
src/lib/components/chat/SettingsModal.svelte
View file @
bfba72d4
...
@@ -28,31 +28,29 @@
...
@@ -28,31 +28,29 @@
let selectedTab = 'general';
let selectedTab = 'general';
const getModels = async (type = 'all') => {
const getModels = async () => {
const models = [];
let models = await Promise.all([
models.push(
await getOllamaModels(localStorage.token).catch((error) => {
...(await getOllamaModels(localStorage.token).catch((error) => {
toast.error(error);
return [];
}))
);
if (type === 'all') {
const openAIModels = await getOpenAIModels(localStorage.token).catch((error) => {
console.log(error);
console.log(error);
return null;
return null;
});
}),
await getOpenAIModels(localStorage.token).catch((error) => {
models.push(...(openAIModels ? [{ name: 'hr' }, ...openAIModels] : []));
console.log(error);
return null;
const liteLLMModels = await getLiteLLMModels(localStorage.token).catch((error) => {
}),
await getLiteLLMModels(localStorage.token).catch((error) => {
console.log(error);
console.log(error);
return null;
return null;
});
})
]);
models.push(...(liteLLMModels ? [{ name: 'hr' }, ...liteLLMModels] : []));
models = models
}
.filter((models) => models)
.reduce((a, e, i, arr) => a.concat(e, ...(i < arr.length - 1 ? [{ name: 'hr' }] : [])), []);
// models.push(...(ollamaModels ? [{ name: 'hr' }, ...ollamaModels] : []));
// models.push(...(openAIModels ? [{ name: 'hr' }, ...openAIModels] : []));
// models.push(...(liteLLMModels ? [{ name: 'hr' }, ...liteLLMModels] : []));
return models;
return models;
};
};
</script>
</script>
...
...
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