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
19d21212
Commit
19d21212
authored
Mar 27, 2024
by
Timothy J. Baek
Browse files
fix: docker issue
parent
7d45d276
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
backend/config.py
backend/config.py
+16
-4
No files found.
backend/config.py
View file @
19d21212
...
@@ -117,7 +117,18 @@ else:
...
@@ -117,7 +117,18 @@ else:
log
=
logging
.
getLogger
(
__name__
)
log
=
logging
.
getLogger
(
__name__
)
log
.
info
(
f
"GLOBAL_LOG_LEVEL:
{
GLOBAL_LOG_LEVEL
}
"
)
log
.
info
(
f
"GLOBAL_LOG_LEVEL:
{
GLOBAL_LOG_LEVEL
}
"
)
log_sources
=
[
"AUDIO"
,
"CONFIG"
,
"DB"
,
"IMAGES"
,
"LITELLM"
,
"MAIN"
,
"MODELS"
,
"OLLAMA"
,
"OPENAI"
,
"RAG"
]
log_sources
=
[
"AUDIO"
,
"CONFIG"
,
"DB"
,
"IMAGES"
,
"LITELLM"
,
"MAIN"
,
"MODELS"
,
"OLLAMA"
,
"OPENAI"
,
"RAG"
,
]
SRC_LOG_LEVELS
=
{}
SRC_LOG_LEVELS
=
{}
...
@@ -239,7 +250,7 @@ OLLAMA_API_BASE_URL = os.environ.get(
...
@@ -239,7 +250,7 @@ OLLAMA_API_BASE_URL = os.environ.get(
)
)
OLLAMA_BASE_URL
=
os
.
environ
.
get
(
"OLLAMA_BASE_URL"
,
""
)
OLLAMA_BASE_URL
=
os
.
environ
.
get
(
"OLLAMA_BASE_URL"
,
""
)
K
UBERNETES_SERVICE_HOST
=
os
.
environ
.
get
(
"KUBERNETES_SERVICE_HOST
"
,
""
)
K
8S_FLAG
=
os
.
environ
.
get
(
"K8S_FLAG
"
,
""
)
if
OLLAMA_BASE_URL
==
""
and
OLLAMA_API_BASE_URL
!=
""
:
if
OLLAMA_BASE_URL
==
""
and
OLLAMA_API_BASE_URL
!=
""
:
OLLAMA_BASE_URL
=
(
OLLAMA_BASE_URL
=
(
...
@@ -249,9 +260,10 @@ if OLLAMA_BASE_URL == "" and OLLAMA_API_BASE_URL != "":
...
@@ -249,9 +260,10 @@ if OLLAMA_BASE_URL == "" and OLLAMA_API_BASE_URL != "":
)
)
if
ENV
==
"prod"
:
if
ENV
==
"prod"
:
if
OLLAMA_BASE_URL
==
"/ollama"
and
KUBERNETES_SERVICE_HOST
==
""
:
if
OLLAMA_BASE_URL
==
"/ollama"
:
OLLAMA_BASE_URL
=
"http://host.docker.internal:11434"
OLLAMA_BASE_URL
=
"http://host.docker.internal:11434"
else
:
elif
K8S_FLAG
:
OLLAMA_BASE_URL
=
"http://ollama-service.open-webui.svc.cluster.local:11434"
OLLAMA_BASE_URL
=
"http://ollama-service.open-webui.svc.cluster.local:11434"
...
...
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