Artifact

View source on GitHub

An artifact object you can write files into, and pass to log_artifact.

Artifact(
name, type, description=None, metadata=None
)

Attributes

digest

entity

id

manifest

project

Methods

add

View source

add(
obj, name
)

Adds obj to the artifact, located at name. You can use Artifact.get(name) after downloading the artifact to retrieve this object.

Arguments

obj (wandb.WBValue): The object to save in an artifact name (str): The path to save

add_dir

View source

add_dir(
local_path, name=None
)

add_file

View source

add_file(
local_path, name=None, is_tmp=False
)

Adds a local file to the artifact

Args

local_path (str): path to the file name (str, optional): new path and filename to assign inside artifact. Defaults to None. is_tmp (bool, optional): If true, then the file is renamed deterministically. Defaults to False.

Returns

ArtifactManifestEntry

the added entry

add_reference

View source

add_reference(
uri, name=None, checksum=True, max_objects=None
)

adds uri to the artifact via a reference, located at name. You can use Artifact.get_path(name) to retrieve this object.

Arguments

uri (str) - the URI path of the reference to add. Can be an object returned from Artifact.get_path to store a reference to another artifact's entry. name (str) - the path to save

download

View source

download()

finalize

View source

finalize()

get

View source

get()

get_added_local_path_name

View source

get_added_local_path_name(
local_path
)

If local_path was already added to artifact, return its internal name.

get_path

View source

get_path(
name
)

new_file

View source

@contextlib.contextmanager
new_file(
name, mode='w'
)