Skip to content

Commit

Permalink
use fit endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoGrin committed Nov 14, 2024
1 parent 368ba9e commit 9f9cd09
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions tabpfn_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def reset_authorization(self):
def is_initialized(self):
return self.access_token is not None and self.access_token != ""

def upload_train_set(self, X, y) -> str:
def fit(self, X, y) -> str:
"""
Upload a train set to server and return the train set UID if successful.
Expand Down Expand Up @@ -200,7 +200,7 @@ def upload_train_set(self, X, y) -> str:
return cached_dataset_uid

response = self.httpx_client.post(
url=self.server_endpoints.upload_train_set.path,
url=self.server_endpoints.fit.path,
files=common_utils.to_httpx_post_file_format(
[
("x_file", "x_train_filename", X_serialized),
Expand All @@ -209,7 +209,7 @@ def upload_train_set(self, X, y) -> str:
),
)

self._validate_response(response, "upload_train_set")
self._validate_response(response, "fit")

train_set_uid = response.json()["train_set_uid"]
self.dataset_uid_cache_manager.add_dataset_uid(dataset_hash, train_set_uid)
Expand Down
5 changes: 5 additions & 0 deletions tabpfn_client/server_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ endpoints:
methods: [ "POST" ]
description: "Upload train set"

fit:
path: "/fit/"
methods: [ "POST" ]
description: "Fit"

predict:
path: "/predict/"
methods: [ "POST" ]
Expand Down
2 changes: 1 addition & 1 deletion tabpfn_client/service_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def fit(self, X, y) -> str:
"Please Note: The email verification token expires in 30 minutes."
)

return self.service_client.upload_train_set(X, y)
return self.service_client.fit(X, y)

def predict(
self,
Expand Down

0 comments on commit 9f9cd09

Please sign in to comment.