Skip to content

Commit 8e58066

Browse files
committed
Fix defaults for LLMParams data model
1 parent f5c8654 commit 8e58066

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

web-apps/image-analysis/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class AppSettings(BaseModel):
3030
page_title: str
3131
page_description: str
3232
examples: List[PromptExample]
33-
llm_params: LLMParams
33+
llm_params: LLMParams | None
3434
# Theme customisation
3535
theme_params: Dict[str, str | list]
3636
theme_params_extended: Dict[str, str]

web-apps/utils/utils.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ class LLMParams(BaseModel):
2020
https://docs.vllm.ai/en/stable/serving/openai_compatible_server.html#extra-parameters
2121
"""
2222

23-
max_tokens: PositiveInt | None
24-
temperature: Annotated[float, Field(ge=0, le=2)] | None
25-
top_p: Annotated[float, Field(gt=0, le=1)] | None
26-
top_k: Annotated[int, Field(ge=-1)] | None
27-
frequency_penalty: Annotated[float, Field(ge=-2, le=2)] | None
28-
presence_penalty: Annotated[float, Field(ge=0 - 2, le=2)] | None
23+
max_tokens: PositiveInt | None = None
24+
temperature: Annotated[float, Field(ge=0, le=2)] | None = None
25+
top_p: Annotated[float, Field(gt=0, le=1)] | None = None
26+
top_k: Annotated[int, Field(ge=-1)] | None = None
27+
frequency_penalty: Annotated[float, Field(ge=-2, le=2)] | None = None
28+
presence_penalty: Annotated[float, Field(ge=0 - 2, le=2)] | None = None
2929
# Make sure we can't smuggle in extra request params / typos
3030
model_config = ConfigDict(extra="forbid")
3131

0 commit comments

Comments
 (0)