Skip to content

Commit 3612afa

Browse files
authored
Suppress pydantic warning for protected namespace (#98)
Tiny PR to suppress a pydantic warning at import time: ``` UserWarning: Field "model_id" in ModelConfig has conflict with protected namespace "model_". You may be able to resolve this warning by setting `model_config['protected_namespaces'] = ()`. warnings.warn( ``` --------- Signed-off-by: SumanthRH <[email protected]>
1 parent d77b932 commit 3612afa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

skythought/evals/models/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from typing import Optional, Union
44

55
import yaml
6-
from pydantic import BaseModel, Field, PrivateAttr, model_validator
6+
from pydantic import BaseModel, ConfigDict, Field, PrivateAttr, model_validator
77

88
MODEL_CONFIG_FILE_PATH = Path(__file__).parent / "model_configs.yaml"
99
# cache the configs in a global var
@@ -35,6 +35,8 @@ def read_yaml(path: str):
3535

3636

3737
class ModelConfig(BaseModel):
38+
model_config = ConfigDict(protected_namespaces=())
39+
3840
model_id: str
3941
name: Optional[str] = Field(default=None)
4042
# can be a string or a path to a file with the string

0 commit comments

Comments
 (0)