Skip to content

Commit

Permalink
remove unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
SecretiveShell committed Sep 14, 2024
1 parent dc4946b commit 533e7c9
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions common/config_models.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from pydantic import BaseModel, ConfigDict, Field, model_validator
from pydantic import BaseModel, ConfigDict, Field
from typing import List, Literal, Optional, Union

from common.utils import unwrap

CACHE_SIZES = Literal["FP16", "Q8", "Q6", "Q4"]


Expand Down Expand Up @@ -311,14 +309,6 @@ class TabbyConfigModel(BaseModel):
default_factory=EmbeddingsConfig.model_construct
)

@model_validator(mode="before")
def set_defaults(cls, values):
for field_name, field_value in values.items():
if field_value is None:
default_instance = cls.__annotations__[field_name]().dict()
values[field_name] = cls.__annotations__[field_name](**default_instance)
return values

model_config = ConfigDict(validate_assignment=True, protected_namespaces=())


Expand All @@ -335,7 +325,7 @@ def dump_def(id: str, indent=2):
comment = section[property]["description"]
yaml += f"{indent}# {comment}\n"

value = unwrap(section[property].get("default"), "")
value = section[property].get("default", "")
yaml += f"{indent}{property}: {value}\n\n"

return yaml + "\n"
Expand Down

0 comments on commit 533e7c9

Please sign in to comment.