Skip to content

Commit c90294e

Browse files
author
Cambio ML
authored
Merge pull request #164 from CambioML/dev
Fix check key in Pydantic BaseModel class bug
2 parents 7ff69fb + fe5ec6c commit c90294e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

uniflow/op/model/model_server.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ def __init__(
9898
self._model_config = model_config
9999
self._example_keys = None
100100

101-
if "few_shot_prompt" in prompt_template and prompt_template.few_shot_prompt:
101+
if (
102+
"few_shot_prompt" in prompt_template.model_fields
103+
and prompt_template.few_shot_prompt # noqa: W503
104+
):
102105
self._example_keys = list(
103106
prompt_template.few_shot_prompt[0].model_dump().keys()
104107
)

0 commit comments

Comments
 (0)