mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-04-20 22:38:55 +00:00
Model + API: Migrate to use BaseSamplerParams
kwargs is pretty ugly when figuring out which arguments to use. The base requests falls back to defaults anyways, so pass in the params object as is. However, since Python's typing isn't like TypeScript where types can be transformed, the type hinting has a possiblity of None showing up despite there always being a value for some params. Signed-off-by: kingbri <8082010+kingbri1@users.noreply.github.com>
This commit is contained in:
@@ -282,6 +282,11 @@ class BaseSamplerRequest(BaseModel):
|
||||
ge=0,
|
||||
)
|
||||
|
||||
logprobs: Optional[int] = Field(
|
||||
default_factory=lambda: get_default_sampler_value("logprobs", 0),
|
||||
ge=0,
|
||||
)
|
||||
|
||||
@field_validator("top_k", mode="before")
|
||||
def convert_top_k(cls, v):
|
||||
"""Fixes instance if Top-K is -1."""
|
||||
|
||||
Reference in New Issue
Block a user