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
eae35ddd
"src/nni_manager/git@developer.sourcefind.cn:OpenDAS/nni.git" did not exist on "3d221da9768c33ccd73bfa1af7bc7e27f99168f3"
Commit
eae35ddd
authored
Aug 12, 2024
by
Timothy J. Baek
Browse files
refac
parent
bb979c9a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
backend/apps/images/main.py
backend/apps/images/main.py
+5
-3
backend/constants.py
backend/constants.py
+1
-0
No files found.
backend/apps/images/main.py
View file @
eae35ddd
...
...
@@ -150,10 +150,11 @@ async def update_engine_url(
else
:
url
=
form_data
.
AUTOMATIC1111_BASE_URL
.
strip
(
"/"
)
try
:
r
=
requests
.
head
(
url
)
r
=
requests
.
head
(
url
)
r
.
raise_for_status
()
app
.
state
.
config
.
AUTOMATIC1111_BASE_URL
=
url
except
Exception
as
e
:
raise
HTTPException
(
status_code
=
400
,
detail
=
"Invalid URL provided."
)
raise
HTTPException
(
status_code
=
400
,
detail
=
ERROR_MESSAGES
.
INVALID_URL
)
if
form_data
.
COMFYUI_BASE_URL
==
None
:
app
.
state
.
config
.
COMFYUI_BASE_URL
=
COMFYUI_BASE_URL
...
...
@@ -162,9 +163,10 @@ async def update_engine_url(
try
:
r
=
requests
.
head
(
url
)
r
.
raise_for_status
()
app
.
state
.
config
.
COMFYUI_BASE_URL
=
url
except
Exception
as
e
:
raise
HTTPException
(
status_code
=
400
,
detail
=
ERROR_MESSAGES
.
DEFAULT
(
e
)
)
raise
HTTPException
(
status_code
=
400
,
detail
=
ERROR_MESSAGES
.
INVALID_URL
)
if
form_data
.
AUTOMATIC1111_API_AUTH
==
None
:
app
.
state
.
config
.
AUTOMATIC1111_API_AUTH
=
AUTOMATIC1111_API_AUTH
...
...
backend/constants.py
View file @
eae35ddd
...
...
@@ -89,6 +89,7 @@ class ERROR_MESSAGES(str, Enum):
OLLAMA_API_DISABLED
=
(
"The Ollama API is disabled. Please enable it to use this feature."
)
INVALID_URL
=
"The URL you provided is invalid. Please double-check and try again."
class
TASKS
(
str
,
Enum
):
...
...
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