Skip to main content
MlFoundryRun.

Properties

Get run_id for the current run

Returns

return
str
Get run_name for the current run

Returns

return
str
Get fqn for the current run

Returns

return
str
Get status for the current run

Returns

return
RunStatus
Get ml_repo name of which the current run is part of

Returns

return
str
Tells whether automatic end for run is True or False

Returns

return
bool

Methods

End a run.

Parameters

status
RunStatus
default:"RunStatus.FINISHED"

Returns

return
None

Usage

from truefoundry.ml import get_client

client = get_client()

client.end(
    status="value",
)
This function permanently delete the run

Returns

return
Any

Usage

from truefoundry.ml import get_client

client = get_client()

client.delete(
)
Get all the version of an artifact from a particular run to download contents or load them in memory

Parameters

artifact_type
Optional[ArtifactType]
default:"ArtifactType.ARTIFACT"

Returns

return
Iterator[ArtifactVersion]

Usage

from truefoundry.ml import get_client

client = get_client()

client.list_artifact_versions(
    artifact_type="value",
)
Get all the version of a models from a particular run to download contents or load them in memory

Returns

return
Iterator[ModelVersion]

Usage

from truefoundry.ml import get_client

client = get_client()

client.list_model_versions(
)
Logs an artifact for the current ML Repo.

Parameters

name
str
required
artifact_paths
List[Union[Tuple[str], Tuple[str, Optional[str]], ArtifactPath]]
required
description
Optional[str]
default:"None"
metadata
Optional[Dict[str, Any]]
default:"None"
step
Optional[int]
default:"0"
progress
Optional[bool]
default:"None"

Returns

return
ArtifactVersion

Usage

from truefoundry.ml import get_client

client = get_client()

client.log_artifact(
    name="my-run",
    artifact_paths=[ArtifactPath("file.txt")],
    description="value",
    metadata="value",
    step="value",
    progress="value",
)
Log metrics for the current run.

Parameters

metric_dict
Dict[str, Union[int, float]]
required
step
int
default:"0"

Returns

return
None

Usage

from truefoundry.ml import get_client

client = get_client()

client.log_metrics(
    metric_dict="value",
    step="value",
)
Logs parameters for the run.

Parameters

param_dict
ParamsType
required
flatten_params
bool
default:"False"

Returns

return
None

Usage

from truefoundry.ml import get_client

client = get_client()

client.log_params(
    param_dict="value",
    flatten_params="value",
)
Set tags for the current run.

Parameters

tags
Dict[str, str]
required

Returns

return
None

Usage

from truefoundry.ml import get_client

client = get_client()

client.set_tags(
    tags={"key": "value"},
)
Returns all the tags set for the current run.

Parameters

no_cache
Any
default:"False"

Returns

return
Dict[str, str]

Usage

from truefoundry.ml import get_client

client = get_client()

client.get_tags(
    no_cache="value",
)
Get metrics logged for the current run grouped by metric name.

Parameters

metric_names
Optional[Iterable[str]]
default:"None"

Returns

return
Dict[str, List[Metric]]

Usage

from truefoundry.ml import get_client

client = get_client()

client.get_metrics(
    metric_names="value",
)
Get all the params logged for the current run.

Parameters

no_cache
Any
default:"False"

Returns

return
Dict[str, str]

Usage

from truefoundry.ml import get_client

client = get_client()

client.get_params(
    no_cache="value",
)
Serialize and log a versioned model under the current ML Repo. Each logged model generates a new version

Parameters

name
str
required
model_file_or_folder
Union[str, BlobStorageDirectory]
required
description
Optional[str]
default:"None"
metadata
Optional[Dict[str, Any]]
default:"None"
step
int
default:"0"
progress
Optional[bool]
default:"None"
framework
Optional[Union[str, ModelFramework, Any]]
default:"None"
environment
Optional[ModelVersionEnvironment]
default:"None"

Returns

return
ModelVersion

Usage

from truefoundry.ml import get_client

client = get_client()

client.log_model(
    name="my-run",
    model_file_or_folder="model.pkl",
    description="value",
    metadata="value",
    step="value",
    progress="value",
    framework="value",
    environment="value",
)
Log images under the current run at the given step.

Parameters

images
Dict[str, Image]
required
step
int
default:"0"

Returns

return
None

Usage

from truefoundry.ml import get_client

client = get_client()

client.log_images(
    images="value",
    step="value",
)
Log custom plots under the current run at the given step.

Parameters

plots
Dict[str, Union[Any, Any, Any, Plot]]
required
step
int
default:"0"

Returns

return
None

Usage

from truefoundry.ml import get_client

client = get_client()

client.log_plots(
    plots="value",
    step="value",
)