mirror of
https://github.com/open-webui/open-webui
synced 2025-02-21 12:29:29 +00:00
feat: log exceptions on update_all_models
This commit is contained in:
parent
715a4a6c27
commit
ae26596d0d
@ -1,4 +1,5 @@
|
|||||||
import json
|
import json
|
||||||
|
import logging
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
import peewee as pw
|
import peewee as pw
|
||||||
@ -7,6 +8,11 @@ from pydantic import BaseModel
|
|||||||
|
|
||||||
from apps.web.internal.db import DB
|
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
|
# 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
|
# 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
|
# It isn't currently used in the backend, but it's here as a reference
|
||||||
class ModelParams(BaseModel):
|
class ModelParams(BaseModel):
|
||||||
"""
|
|
||||||
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.
|
|
||||||
"""
|
|
||||||
|
|
||||||
description: str
|
description: str
|
||||||
|
"""
|
||||||
|
User-facing description of the model.
|
||||||
|
"""
|
||||||
|
|
||||||
vision_capable: bool
|
vision_capable: bool
|
||||||
|
"""
|
||||||
|
A flag indicating if the model is capable of vision and thus image inputs
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
class Model(pw.Model):
|
class Model(pw.Model):
|
||||||
@ -151,6 +156,7 @@ class ModelsTable:
|
|||||||
|
|
||||||
return True
|
return True
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
log.exception(e)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user