Skip to content

RuntimeError: Fail to call fit with error: 413, reason: Request Entity Too Large and text #102

@alanarazi7

Description

@alanarazi7

When trying to fit a heavily-textual dataset (melbourne-airbnb) through the API, I run into a RuntimeError. This isn't happening with a lot of other similar datasets. I didn't dive into the specific, but this dataset has A LOT of strings, and maybe some of them are very long.

import openml
from tabpfn_client import TabPFNRegressor

# naive example to replicate bug
dataset = openml.datasets.get_dataset(46665, download_data=True, download_features_meta_data=True)
x, y, _, _ = dataset.get_data(target=dataset.default_target_attribute)
x_train = x[:10000]
y_train = y[:10000]
x_test = x[10000:]
y_test = y[10000:]
model = TabPFNRegressor()
model.fit(x_train, y_train)
model.predict(x_test)

The error:

Could not download file from https://data.openml.org/datasets/0004/46665/dataset_46665.pq: Object at 'https://data.openml.org/datasets/0004/46665/dataset_46665.pq' does not exist.
Failed to download parquet, fallback on ARFF.
  Welcome Back! Found existing access token, reusing it for authentication.
ERROR:tabpfn_client.client:Fail to call fit, response status: 413
Traceback (most recent call last):
  File "/Users/alanarazi/Desktop/Personal/tabular/.venv/lib/python3.11/site-packages/IPython/core/interactiveshell.py", line 3579, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-12-340f9c3d548b>", line 9, in <module>
    model.fit(x_train, y_train)
  File "/Users/alanarazi/Desktop/Personal/tabular/.venv/lib/python3.11/site-packages/tabpfn_client/estimator.py", line 311, in fit
    self.last_train_set_uid = InferenceClient.fit(X, y, config=estimator_param)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/alanarazi/Desktop/Personal/tabular/.venv/lib/python3.11/site-packages/tabpfn_client/service_wrapper.py", line 225, in fit
    return ServiceClient.fit(X, y, config=config)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/alanarazi/Desktop/Personal/tabular/.venv/lib/python3.11/site-packages/tabpfn_client/client.py", line 237, in fit
    cls._validate_response(response, "fit")
  File "/Users/alanarazi/Desktop/Personal/tabular/.venv/lib/python3.11/site-packages/tabpfn_client/client.py", line 477, in _validate_response
    raise RuntimeError(
RuntimeError: Fail to call fit with error: 413, reason: Request Entity Too Large and text: 
<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>413 Request Entity Too Large</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Request Entity Too Large</h1>
<h2>Your client issued a request that was too large.
</h2>
<h2></h2>
</body></html>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions