mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
fix(ml): handle missing context_length field (#6695)
* handle missing `context_length` field * specify list type
This commit is contained in:
parent
e2ac019f51
commit
2249f7d42a
3 changed files with 12 additions and 9 deletions
|
|
@ -70,6 +70,8 @@ LOG_LEVELS: dict[str, int] = {
|
|||
settings = Settings()
|
||||
log_settings = LogSettings()
|
||||
|
||||
LOG_LEVEL = LOG_LEVELS.get(log_settings.log_level.lower(), logging.INFO)
|
||||
|
||||
|
||||
class CustomRichHandler(RichHandler):
|
||||
def __init__(self) -> None:
|
||||
|
|
@ -81,6 +83,7 @@ class CustomRichHandler(RichHandler):
|
|||
console=console,
|
||||
rich_tracebacks=True,
|
||||
tracebacks_suppress=[*self.excluded, concurrent.futures],
|
||||
tracebacks_show_locals=LOG_LEVEL == logging.DEBUG,
|
||||
)
|
||||
|
||||
# hack to exclude certain modules from rich tracebacks
|
||||
|
|
@ -96,7 +99,7 @@ class CustomRichHandler(RichHandler):
|
|||
|
||||
|
||||
log = logging.getLogger("ml.log")
|
||||
log.setLevel(LOG_LEVELS.get(log_settings.log_level.lower(), logging.INFO))
|
||||
log.setLevel(LOG_LEVEL)
|
||||
|
||||
|
||||
# patches this issue https://github.com/encode/uvicorn/discussions/1803
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue