From 75e8521eb925541657c452d159b83a84bb364ed4 Mon Sep 17 00:00:00 2001 From: Tim Shih Date: Fri, 1 Dec 2023 10:37:14 +0800 Subject: [PATCH] fix warning for pydantic 2 --- clients/python/text_generation/types.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/clients/python/text_generation/types.py b/clients/python/text_generation/types.py index aa02d8d8..d7e02ea2 100644 --- a/clients/python/text_generation/types.py +++ b/clients/python/text_generation/types.py @@ -243,5 +243,11 @@ class StreamResponse(BaseModel): # Inference API currently deployed model class DeployedModel(BaseModel): + model_config = { + # Pydantic 2 sets `model_` prefix as protected namespace and raises a + # warning when this model is loaded. Set this option to disable the warning. + "protected_namespaces": (), + } + model_id: str sha: str