FoundationModel¶
- class autogluon.cloud.FoundationModel(model_id: str, **kwargs)[source]¶
Pretrained foundation model inference on AWS.
Factory:
FoundationModel(model_id, ...)dispatches on the model’s task and returns the appropriate task-specific subclass (TimeSeriesFoundationModel,TabularFoundationModel). Most users instantiate the subclass directly instead.Examples
>>> model = FoundationModel("chronos-2") # returns a TimeSeriesFoundationModel >>> predictions = model.predict(data, prediction_length=24)
- Parameters:
model_id – ID of the foundation model from the model registry. See Available models in the foundation model tutorial for the list of supported values.
cloud_output_path –
S3 location where intermediate artifacts are stored. Accepts:
s3://bucket— a unique timestamped subfolderag-<timestamp>is appended.s3://bucket/prefix— used verbatim. Re-running with the same prefix will overwrite previously written artifacts.None(default) — use the bucket saved in~/.autogluon/cloud.yaml(set byautogluon.cloud.bootstrap()/autogluon.cloud.register()) and append a timestamped subfolder. Raises if no bucket is configured.
hyperparameters – Default hyperparameters applied to inference and (when supported) training.
model_artifact_uri – S3 URI of a pre-bundled
model.tar.gzproduced bycache_model_artifact(). When set, deploys skip the runtime HuggingFace download and load weights from the bundled artifact.backend – Backend name or reusable
SageMakerConfigwith region, execution role, networking, encryption and tags."sagemaker"uses default settings.
Methods
Download model weights from HuggingFace, bundle them with the FM serve script into a SageMaker-compatible
model.tar.gz, and upload to S3.Deploy model to a real-time endpoint.
Restore from
to_dict()output.Restore from a
to_json()string.Subclasses override with task-specific signature.
Serialize the model identity.
Serialize
to_dict()output as a JSON string.