Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/tabpfn_client/api_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ class ClassifierPredictParams(BaseModel):
) = None


class FitMode(str, Enum):
# Only the two values that gapi wires end-to-end. The server-side enum
# also has internal `low_memory` / `batched` modes, but those are not
# accepted by the public API — see `FitRequest._validate_fit_mode`.
FIT_PREPROCESSORS = "fit_preprocessors"
FIT_WITH_CACHE = "fit_with_cache"


class ClassifierTabPFNConfig(BaseModel):
n_estimators: int | None = None
categorical_features_indices: list[int] | None = None
Expand All @@ -65,6 +73,7 @@ class ClassifierTabPFNConfig(BaseModel):
Annotated[Literal["autocast", "auto"] | str, Field(union_mode="left_to_right")] | None
) = None
ignore_pretraining_limits: bool | None = None
fit_mode: Annotated[FitMode | UnknownEnum, Field(union_mode="left_to_right")] | None = None
model_path: str | None = None
balance_probabilities: bool | None = None

Expand Down Expand Up @@ -161,6 +170,7 @@ class RegressorTabPFNConfig(BaseModel):
Annotated[Literal["autocast", "auto"] | str, Field(union_mode="left_to_right")] | None
) = None
ignore_pretraining_limits: bool | None = None
fit_mode: Annotated[FitMode | UnknownEnum, Field(union_mode="left_to_right")] | None = None
model_path: str | None = None


Expand Down Expand Up @@ -226,7 +236,7 @@ class FitRequest(BaseModel):
)
async_mode: bool | None = Field(
default=None,
description="Submit the fit and return immediately with status=pending; poll GET /tabpfn/fit/{fitted_train_set_id} for the outcome. Defaults to the blocking behaviour.",
description="Submit the fit and return immediately with status=pending; poll GET /fit/{fitted_train_set_id} for the outcome. Defaults to the blocking behaviour.",
)


Expand All @@ -239,6 +249,7 @@ class FitStatusResponse(BaseModel):
fitted_train_set_id: UUID
status: Annotated[FitStatus | UnknownEnum, Field(union_mode="left_to_right")]
error: str | None = None
error_code: str | None = None


class GetModelLimitsResponse(BaseModel):
Expand Down
Loading
Loading