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
ae26596d
"...git@developer.sourcefind.cn:chenpangpang/open-webui.git" did not exist on "1f02940bbd07ad5e1cd9b76904b0f8f0b33a2034"
Commit
ae26596d
authored
May 19, 2024
by
Jun Siang Cheah
Browse files
feat: log exceptions on update_all_models
parent
715a4a6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
backend/apps/web/models/models.py
backend/apps/web/models/models.py
+12
-6
No files found.
backend/apps/web/models/models.py
View file @
ae26596d
import
json
import
logging
from
typing
import
Optional
import
peewee
as
pw
...
...
@@ -7,6 +8,11 @@ from pydantic import BaseModel
from
apps.web.internal.db
import
DB
from
config
import
SRC_LOG_LEVELS
log
=
logging
.
getLogger
(
__name__
)
log
.
setLevel
(
SRC_LOG_LEVELS
[
"MODELS"
])
####################
# Models DB Schema
...
...
@@ -16,16 +22,15 @@ from apps.web.internal.db import DB
# ModelParams is a model for the data stored in the params field of the Model table
# It isn't currently used in the backend, but it's here as a reference
class
ModelParams
(
BaseModel
):
description
:
str
"""
A Pydantic model that represents the parameters of a model.
Attributes:
description (str): A description of the model.
vision_capable (bool): A flag indicating if the model is capable of vision and thus image inputs.
User-facing description of the model.
"""
description
:
str
vision_capable
:
bool
"""
A flag indicating if the model is capable of vision and thus image inputs
"""
class
Model
(
pw
.
Model
):
...
...
@@ -151,6 +156,7 @@ class ModelsTable:
return
True
except
Exception
as
e
:
log
.
exception
(
e
)
return
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