Skip to content

Commit 027ee21

Browse files
authored
Update to fix pydantic warning (#7193)
Warning: ``` site-packages/deepspeed/runtime/config_utils.py:64: PydanticDeprecatedSince211: Accessing this attribute on the instance is deprecated, and will be removed in Pydantic V3. Instead, you should access this attribute from the model class. Deprecated in Pydantic V2.11 to be removed in V3.0. kwargs = pydantic_config.model_fields[dep_field].json_schema_extra ``` Signed-off-by: Logan Adams <[email protected]>
1 parent 3c1817f commit 027ee21

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: deepspeed/runtime/config_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def _process_deprecated_field(self, dep_field):
6161
# Get information about the deprecated field
6262
pydantic_config = self
6363
fields_set = pydantic_config.model_fields_set
64-
kwargs = pydantic_config.model_fields[dep_field].json_schema_extra
64+
kwargs = type(pydantic_config).model_fields[dep_field].json_schema_extra
6565
new_param_fn = kwargs.get("new_param_fn", lambda x: x)
6666
param_value = new_param_fn(getattr(pydantic_config, dep_field))
6767
new_field = kwargs.get("new_param", "")

0 commit comments

Comments
 (0)