hotfix to exclude_unset from pydantic config when converting back to a dict (#1334)
Browse files
src/axolotl/utils/config/__init__.py
CHANGED
|
@@ -199,9 +199,15 @@ def normalize_cfg_datasets(cfg):
|
|
| 199 |
def validate_config(cfg: DictDefault, capabilities: Optional[dict] = None):
|
| 200 |
if capabilities:
|
| 201 |
return DictDefault(
|
| 202 |
-
dict(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 203 |
)
|
| 204 |
-
return DictDefault(
|
|
|
|
|
|
|
| 205 |
|
| 206 |
|
| 207 |
def legacy_validate_config(cfg):
|
|
|
|
| 199 |
def validate_config(cfg: DictDefault, capabilities: Optional[dict] = None):
|
| 200 |
if capabilities:
|
| 201 |
return DictDefault(
|
| 202 |
+
dict(
|
| 203 |
+
AxolotlConfigWCapabilities(
|
| 204 |
+
**cfg.to_dict(), capabilities=capabilities
|
| 205 |
+
).model_dump(exclude_unset=True)
|
| 206 |
+
)
|
| 207 |
)
|
| 208 |
+
return DictDefault(
|
| 209 |
+
dict(AxolotlInputConfig(**cfg.to_dict()).model_dump(exclude_unset=True))
|
| 210 |
+
)
|
| 211 |
|
| 212 |
|
| 213 |
def legacy_validate_config(cfg):
|