optuna_dashboard.artifact.upload_artifact
- optuna_dashboard.artifact.upload_artifact(backend, trial, file_path, *, mimetype=None, encoding=None)
Upload an artifact (files), which is associated with the trial.
Warning
This function is deprecated. Please use optuna.artifacts.upload_artifact instead.
Example
import optuna from optuna_dashboard.artifact import upload_artifact from optuna_dashboard.artifact.file_system import FileSystemBackend artifact_backend = FileSystemBackend("./tmp/") def objective(trial: optuna.Trial) -> float: ... = trial.suggest_float("x", -10, 10) file_path = generate_example_png(...) upload_artifact(artifact_backend, trial, file_path) return ...
- Parameters:
backend (ArtifactBackend) –
trial (optuna.Trial) –
file_path (str) –
mimetype (Optional[str]) –
encoding (Optional[str]) –
- Return type:
str