From e977c111112220a163ded260554684d7dd1882a1 Mon Sep 17 00:00:00 2001 From: Maximilien de Bayser Date: Tue, 25 Mar 2025 17:31:08 -0300 Subject: [PATCH] Add workaround for shared field_names in pydantic model class (#13925) Signed-off-by: Max de Bayser --- vllm/entrypoints/openai/protocol.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vllm/entrypoints/openai/protocol.py b/vllm/entrypoints/openai/protocol.py index a96ca1f757008..032dc49d16de1 100644 --- a/vllm/entrypoints/openai/protocol.py +++ b/vllm/entrypoints/openai/protocol.py @@ -1238,6 +1238,9 @@ class ChatCompletionLogProb(OpenAIBaseModel): class ChatCompletionLogProbsContent(ChatCompletionLogProb): + # Workaround: redefine fields name cache so that it's not + # shared with the super class. + field_names: ClassVar[Optional[set[str]]] = None top_logprobs: list[ChatCompletionLogProb] = Field(default_factory=list)