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
16fa4545
"src/lib/vscode:/vscode.git/clone" did not exist on "7bbb6bdabea4cb8ea2bd9772d2e9517d1f19524d"
Commit
16fa4545
authored
Jul 02, 2024
by
Michael Poluektov
Browse files
fix banners env
parent
e4c85921
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
backend/config.py
backend/config.py
+9
-8
No files found.
backend/config.py
View file @
16fa4545
...
@@ -5,10 +5,10 @@ import importlib.metadata
...
@@ -5,10 +5,10 @@ import importlib.metadata
import
pkgutil
import
pkgutil
import
chromadb
import
chromadb
from
chromadb
import
Settings
from
chromadb
import
Settings
from
base64
import
b64encode
from
bs4
import
BeautifulSoup
from
bs4
import
BeautifulSoup
from
typing
import
TypeVar
,
Generic
,
Union
from
typing
import
TypeVar
,
Generic
from
pydantic
import
BaseModel
from
pydantic
import
BaseModel
from
pydantic.error_wrappers
import
ValidationError
from
typing
import
Optional
from
typing
import
Optional
from
pathlib
import
Path
from
pathlib
import
Path
...
@@ -19,7 +19,6 @@ import markdown
...
@@ -19,7 +19,6 @@ import markdown
import
requests
import
requests
import
shutil
import
shutil
from
secrets
import
token_bytes
from
constants
import
ERROR_MESSAGES
from
constants
import
ERROR_MESSAGES
####################################
####################################
...
@@ -768,12 +767,14 @@ class BannerModel(BaseModel):
...
@@ -768,12 +767,14 @@ class BannerModel(BaseModel):
dismissible
:
bool
dismissible
:
bool
timestamp
:
int
timestamp
:
int
try
:
banners
=
json
.
loads
(
os
.
environ
.
get
(
"WEBUI_BANNERS"
,
"[]"
))
banners
=
[
BannerModel
(
**
banner
)
for
banner
in
banners
]
except
ValidationError
as
e
:
print
(
f
"Error loading WEBUI_BANNERS:
{
e
}
"
)
banners
=
[]
WEBUI_BANNERS
=
PersistentConfig
(
WEBUI_BANNERS
=
PersistentConfig
(
"WEBUI_BANNERS"
,
"ui.banners"
,
banners
)
"WEBUI_BANNERS"
,
"ui.banners"
,
[
BannerModel
(
**
banner
)
for
banner
in
json
.
loads
(
"[]"
)],
)
SHOW_ADMIN_DETAILS
=
PersistentConfig
(
SHOW_ADMIN_DETAILS
=
PersistentConfig
(
...
...
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