From 5b2155b0f8ace2985b3d8e109fed88769d7395ee Mon Sep 17 00:00:00 2001 From: Jeff Date: Tue, 25 Jun 2024 04:10:32 -0400 Subject: [PATCH] corrected Pydantic warning. (#2095) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * corrected Pydantic warning. * Update clients/python/text_generation/types.py Co-authored-by: Daniël de Kok --------- Co-authored-by: Nicolas Patry Co-authored-by: Daniël de Kok --- clients/python/text_generation/types.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/clients/python/text_generation/types.py b/clients/python/text_generation/types.py index eb872ee6..497468d9 100644 --- a/clients/python/text_generation/types.py +++ b/clients/python/text_generation/types.py @@ -1,5 +1,5 @@ from enum import Enum -from pydantic import BaseModel, field_validator +from pydantic import BaseModel, field_validator, ConfigDict from typing import Optional, List, Union, Any from text_generation.errors import ValidationError @@ -452,5 +452,9 @@ class StreamResponse(BaseModel): # Inference API currently deployed model class DeployedModel(BaseModel): + # Disable warning for use of `model_` prefix in `model_id`. Be mindful about adding members + # with model_ prefixes, since this disables guardrails for colliding fields: + # https://github.com/pydantic/pydantic/issues/9177 + model_config = ConfigDict(protected_namespaces=()) model_id: str sha: str