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
d43ee0fc
Unverified
Commit
d43ee0fc
authored
May 21, 2024
by
Timothy Jaeryang Baek
Committed by
GitHub
May 21, 2024
Browse files
Merge pull request #2465 from open-webui/dev
fix
parents
3355577b
6b57d8d3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
38 deletions
+74
-38
.github/workflows/docker-build.yaml
.github/workflows/docker-build.yaml
+37
-7
src/routes/(app)/+page.svelte
src/routes/(app)/+page.svelte
+21
-16
src/routes/(app)/c/[id]/+page.svelte
src/routes/(app)/c/[id]/+page.svelte
+16
-15
No files found.
.github/workflows/docker-build.yaml
View file @
d43ee0fc
...
@@ -63,6 +63,16 @@ jobs:
...
@@ -63,6 +63,16 @@ jobs:
flavor
:
|
flavor
:
|
latest=${{ github.ref == 'refs/heads/main' }}
latest=${{ github.ref == 'refs/heads/main' }}
-
name
:
Extract metadata for Docker cache
id
:
cache-meta
uses
:
docker/metadata-action@v5
with
:
images
:
${{ env.FULL_IMAGE_NAME }}
tags
:
|
type=ref,event=branch
flavor
:
|
prefix=cache-${{ matrix.platform }}-
-
name
:
Build Docker image (latest)
-
name
:
Build Docker image (latest)
uses
:
docker/build-push-action@v5
uses
:
docker/build-push-action@v5
id
:
build
id
:
build
...
@@ -72,8 +82,8 @@ jobs:
...
@@ -72,8 +82,8 @@ jobs:
platforms
:
${{ matrix.platform }}
platforms
:
${{ matrix.platform }}
labels
:
${{ steps.meta.outputs.labels }}
labels
:
${{ steps.meta.outputs.labels }}
outputs
:
type=image,name=${{ env.FULL_IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
outputs
:
type=image,name=${{ env.FULL_IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
cache-from
:
type=
gha
cache-from
:
type=
registry,ref=${{ steps.cache-meta.outputs.tags }}
cache-to
:
type=
gha
,mode=max
cache-to
:
type=
registry,ref=${{ steps.cache-meta.outputs.tags }}
,mode=max
-
name
:
Export digest
-
name
:
Export digest
run
:
|
run
:
|
...
@@ -123,7 +133,7 @@ jobs:
...
@@ -123,7 +133,7 @@ jobs:
username
:
${{ github.actor }}
username
:
${{ github.actor }}
password
:
${{ secrets.GITHUB_TOKEN }}
password
:
${{ secrets.GITHUB_TOKEN }}
-
name
:
Extract metadata for Docker images (
default latest
tag)
-
name
:
Extract metadata for Docker images (
cuda
tag)
id
:
meta
id
:
meta
uses
:
docker/metadata-action@v5
uses
:
docker/metadata-action@v5
with
:
with
:
...
@@ -139,6 +149,16 @@ jobs:
...
@@ -139,6 +149,16 @@ jobs:
latest=${{ github.ref == 'refs/heads/main' }}
latest=${{ github.ref == 'refs/heads/main' }}
suffix=-cuda,onlatest=true
suffix=-cuda,onlatest=true
-
name
:
Extract metadata for Docker cache
id
:
cache-meta
uses
:
docker/metadata-action@v5
with
:
images
:
${{ env.FULL_IMAGE_NAME }}
tags
:
|
type=ref,event=branch
flavor
:
|
prefix=cache-cuda-${{ matrix.platform }}-
-
name
:
Build Docker image (cuda)
-
name
:
Build Docker image (cuda)
uses
:
docker/build-push-action@v5
uses
:
docker/build-push-action@v5
id
:
build
id
:
build
...
@@ -148,8 +168,8 @@ jobs:
...
@@ -148,8 +168,8 @@ jobs:
platforms
:
${{ matrix.platform }}
platforms
:
${{ matrix.platform }}
labels
:
${{ steps.meta.outputs.labels }}
labels
:
${{ steps.meta.outputs.labels }}
outputs
:
type=image,name=${{ env.FULL_IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
outputs
:
type=image,name=${{ env.FULL_IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
cache-from
:
type=
gha
cache-from
:
type=
registry,ref=${{ steps.cache-meta.outputs.tags }}
cache-to
:
type=
gha
,mode=max
cache-to
:
type=
registry,ref=${{ steps.cache-meta.outputs.tags }}
,mode=max
build-args
:
USE_CUDA=true
build-args
:
USE_CUDA=true
-
name
:
Export digest
-
name
:
Export digest
...
@@ -216,6 +236,16 @@ jobs:
...
@@ -216,6 +236,16 @@ jobs:
latest=${{ github.ref == 'refs/heads/main' }}
latest=${{ github.ref == 'refs/heads/main' }}
suffix=-ollama,onlatest=true
suffix=-ollama,onlatest=true
-
name
:
Extract metadata for Docker cache
id
:
cache-meta
uses
:
docker/metadata-action@v5
with
:
images
:
${{ env.FULL_IMAGE_NAME }}
tags
:
|
type=ref,event=branch
flavor
:
|
prefix=cache-ollama-${{ matrix.platform }}-
-
name
:
Build Docker image (ollama)
-
name
:
Build Docker image (ollama)
uses
:
docker/build-push-action@v5
uses
:
docker/build-push-action@v5
id
:
build
id
:
build
...
@@ -225,8 +255,8 @@ jobs:
...
@@ -225,8 +255,8 @@ jobs:
platforms
:
${{ matrix.platform }}
platforms
:
${{ matrix.platform }}
labels
:
${{ steps.meta.outputs.labels }}
labels
:
${{ steps.meta.outputs.labels }}
outputs
:
type=image,name=${{ env.FULL_IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
outputs
:
type=image,name=${{ env.FULL_IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
cache-from
:
type=
gha
cache-from
:
type=
registry,ref=${{ steps.cache-meta.outputs.tags }}
cache-to
:
type=
gha
,mode=max
cache-to
:
type=
registry,ref=${{ steps.cache-meta.outputs.tags }}
,mode=max
build-args
:
USE_OLLAMA=true
build-args
:
USE_OLLAMA=true
-
name
:
Export digest
-
name
:
Export digest
...
...
src/routes/(app)/+page.svelte
View file @
d43ee0fc
<
script
lang
=
"ts"
>
<
script
lang
=
"ts"
>
import
{
v4
as
uuidv4
}
from
'uuid'
;
import
{
toast
}
from
'svelte-sonner'
;
import
{
toast
}
from
'svelte-sonner'
;
import
{
v4
as
uuidv4
}
from
'uuid'
;
import
{
onMount
,
tick
,
getContext
}
from
'svelte'
;
import
{
goto
}
from
'$app/navigation'
;
import
{
goto
}
from
'$app/navigation'
;
import
{
page
}
from
'$app/stores'
;
import
{
page
}
from
'$app/stores'
;
import
{
getContext
,
onMount
,
tick
}
from
'svelte'
;
import
{
import
{
models
,
modelfiles
,
user
,
settings
,
chats
,
chatId
,
config
,
WEBUI_NAME
,
WEBUI_NAME
,
tags
as
_tags
,
tags
as
_tags
,
showSidebar
chatId
,
chats
,
config
,
modelfiles
,
models
,
settings
,
showSidebar
,
user
}
from
'$lib/stores'
;
}
from
'$lib/stores'
;
import
{
copyToClipboard
,
splitStream
}
from
'$lib/utils'
;
import
{
copyToClipboard
,
splitStream
}
from
'$lib/utils'
;
import
{
generateChatCompletion
,
cancelOllamaRequest
}
from
'$lib/apis/ollama'
;
import
{
import
{
addTagById
,
addTagById
,
createNewChat
,
createNewChat
,
...
@@ -30,18 +29,23 @@
...
@@ -30,18 +29,23 @@
getTagsById
,
getTagsById
,
updateChatById
updateChatById
}
from
'$lib/apis/chats'
;
}
from
'$lib/apis/chats'
;
import
{
queryCol
le
c
tion
,
queryDoc
}
from
'$lib/apis/
rag
'
;
import
{
cancelOllamaRequest
,
generateChatComp
letion
}
from
'$lib/apis/
ollama
'
;
import
{
generateOpenAIChatCompletion
,
generateTitle
}
from
'$lib/apis/openai'
;
import
{
generateOpenAIChatCompletion
,
generateTitle
}
from
'$lib/apis/openai'
;
import
{
queryCollection
,
queryDoc
}
from
'$lib/apis/rag'
;
import
{
queryMemory
}
from
'$lib/apis/memories'
;
import
{
createOpenAITextStream
}
from
'$lib/apis/streaming'
;
import
MessageInput
from
'$lib/components/chat/MessageInput.svelte'
;
import
MessageInput
from
'$lib/components/chat/MessageInput.svelte'
;
import
Messages
from
'$lib/components/chat/Messages.svelte'
;
import
Messages
from
'$lib/components/chat/Messages.svelte'
;
import
ModelSelector
from
'$lib/components/chat/ModelSelector.svelte'
;
import
ModelSelector
from
'$lib/components/chat/ModelSelector.svelte'
;
import
Navbar
from
'$lib/components/layout/Navbar.svelte'
;
import
Navbar
from
'$lib/components/layout/Navbar.svelte'
;
import
{
LITELLM_API_BASE_URL
,
OLLAMA_API_BASE_URL
,
OPENAI_API_BASE_URL
,
WEBUI_BASE_URL
}
from
'$lib/constants'
;
import
{
RAGTemplate
}
from
'$lib/utils/rag'
;
import
{
RAGTemplate
}
from
'$lib/utils/rag'
;
import
{
LITELLM_API_BASE_URL
,
OLLAMA_API_BASE_URL
,
OPENAI_API_BASE_URL
}
from
'$lib/constants'
;
import
{
WEBUI_BASE_URL
}
from
'$lib/constants'
;
import
{
createOpenAITextStream
}
from
'$lib/apis/streaming'
;
import
{
queryMemory
}
from
'$lib/apis/memories'
;
const
i18n
=
getContext
(
'i18n'
);
const
i18n
=
getContext
(
'i18n'
);
...
@@ -614,6 +618,7 @@
...
@@ -614,6 +618,7 @@
...messages
...messages
]
]
.filter((message) => message)
.filter((message) => message)
.filter((message) => message.content != '')
.map((message, idx, arr) => ({
.map((message, idx, arr) => ({
role: message.role,
role: message.role,
...((message.files?.filter((file) => file.type === 'image').length > 0 ?? false) &&
...((message.files?.filter((file) => file.type === 'image').length > 0 ?? false) &&
...
...
src/routes/(app)/c/[id]/+page.svelte
View file @
d43ee0fc
<
script
lang
=
"ts"
>
<
script
lang
=
"ts"
>
import
{
v4
as
uuidv4
}
from
'uuid'
;
import
{
toast
}
from
'svelte-sonner'
;
import
{
toast
}
from
'svelte-sonner'
;
import
{
v4
as
uuidv4
}
from
'uuid'
;
import
{
onMount
,
tick
,
getContext
}
from
'svelte'
;
import
{
goto
}
from
'$app/navigation'
;
import
{
goto
}
from
'$app/navigation'
;
import
{
page
}
from
'$app/stores'
;
import
{
page
}
from
'$app/stores'
;
import
{
import
{
models
,
modelfiles
,
user
,
settings
,
chats
,
chatId
,
config
,
WEBUI_NAME
,
WEBUI_NAME
,
tags
as
_tags
,
tags
as
_tags
,
showSidebar
chatId
,
chats
,
config
,
modelfiles
,
models
,
settings
,
showSidebar
,
user
}
from
'$lib/stores'
;
}
from
'$lib/stores'
;
import
{
copyToClipboard
,
splitStream
,
convertMessagesToHistory
}
from
'$lib/utils'
;
import
{
convertMessagesToHistory
,
copyToClipboard
,
splitStream
}
from
'$lib/utils'
;
import
{
getContext
,
onMount
,
tick
}
from
'svelte'
;
import
{
generateChatCompletion
,
cancelOllamaRequest
}
from
'$lib/apis/ollama'
;
import
{
import
{
addTagById
,
addTagById
,
createNewChat
,
createNewChat
,
...
@@ -30,20 +29,21 @@
...
@@ -30,20 +29,21 @@
getTagsById
,
getTagsById
,
updateChatById
updateChatById
}
from
'$lib/apis/chats'
;
}
from
'$lib/apis/chats'
;
import
{
cancelOllamaRequest
,
generateChatCompletion
}
from
'$lib/apis/ollama'
;
import
{
generateOpenAIChatCompletion
,
generateTitle
}
from
'$lib/apis/openai'
;
import
{
generateOpenAIChatCompletion
,
generateTitle
}
from
'$lib/apis/openai'
;
import
MessageInput
from
'$lib/components/chat/MessageInput.svelte'
;
import
MessageInput
from
'$lib/components/chat/MessageInput.svelte'
;
import
Messages
from
'$lib/components/chat/Messages.svelte'
;
import
Messages
from
'$lib/components/chat/Messages.svelte'
;
import
Navbar
from
'$lib/components/layout/Navbar.svelte'
;
import
Navbar
from
'$lib/components/layout/Navbar.svelte'
;
import
{
queryMemory
}
from
'$lib/apis/memories'
;
import
{
createOpenAITextStream
}
from
'$lib/apis/streaming'
;
import
{
import
{
LITELLM_API_BASE_URL
,
LITELLM_API_BASE_URL
,
OPENAI_API_BASE_URL
,
OLLAMA_API_BASE_URL
,
OLLAMA_API_BASE_URL
,
OPENAI_API_BASE_URL
,
WEBUI_BASE_URL
WEBUI_BASE_URL
}
from
'$lib/constants'
;
}
from
'$lib/constants'
;
import
{
createOpenAITextStream
}
from
'$lib/apis/streaming'
;
import
{
queryMemory
}
from
'$lib/apis/memories'
;
const
i18n
=
getContext
(
'i18n'
);
const
i18n
=
getContext
(
'i18n'
);
...
@@ -620,6 +620,7 @@
...
@@ -620,6 +620,7 @@
...messages
...messages
]
]
.filter((message) => message)
.filter((message) => message)
.filter((message) => message.content != '')
.map((message, idx, arr) => ({
.map((message, idx, arr) => ({
role: message.role,
role: message.role,
...((message.files?.filter((file) => file.type === 'image').length > 0 ?? false) &&
...((message.files?.filter((file) => file.type === 'image').length > 0 ?? false) &&
...
...
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