mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-03-15 00:07:28 +00:00
Cleanup config file loader (#208)
* fix config file loader * prune nonetype values from config dict fixes default values not initialising properly * Utils: Shrink None removal function It is more concise to use a list and dict collection if necessary rather than iterating through and checking each value. Tested and works with Tabby's cases. Signed-off-by: kingbri <bdashore3@proton.me> --------- Signed-off-by: kingbri <bdashore3@proton.me> Co-authored-by: kingbri <bdashore3@proton.me>
This commit is contained in:
@@ -9,7 +9,7 @@ from loguru import logger
|
||||
from pydantic import AliasChoices, BaseModel, Field
|
||||
from typing import Dict, List, Optional, Union
|
||||
|
||||
from common.utils import unwrap, prune_dict
|
||||
from common.utils import filter_none_values, unwrap
|
||||
|
||||
|
||||
# Common class for sampler params
|
||||
@@ -403,7 +403,7 @@ def overrides_from_dict(new_overrides: dict):
|
||||
"""Wrapper function to update sampler overrides"""
|
||||
|
||||
if isinstance(new_overrides, dict):
|
||||
overrides_container.overrides = prune_dict(new_overrides)
|
||||
overrides_container.overrides = filter_none_values(new_overrides)
|
||||
else:
|
||||
raise TypeError("New sampler overrides must be a dict!")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user