optuna.artifacts.upload_artifact

optuna.artifacts.upload_artifact(trial, file_path, artifact_store, *, storage=None)[source]

Upload an artifact to the artifact store.

Parameters:
  • trial (Trial | FrozenTrial) – A Trial object, or a FrozenTrial object.

  • file_path (str) – A path to the file to be uploaded.

  • artifact_store (ArtifactStore) – An artifact store.

  • storage (BaseStorage | None) – A storage object. If trial is not a Trial object, this argument is required.

Returns:

An artifact ID.

Return type:

str

Note

Added in v3.3.0 as an experimental feature. The interface may change in newer versions without prior notice. See https://github.com/optuna/optuna/releases/tag/v3.3.0.