Documentation Index
Fetch the complete documentation index at: https://wb-21fd5541-python-sdk-testing.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Description
Flexible and lightweight building block for dataset and model versioning. Construct an empty W&B Artifact. Populate an artifacts contents with methods that begin withadd. Once the artifact has all the desired files, you can call
run.log_artifact() to log it.
Args:
- name: A human-readable name for the artifact. Use the name to identify a specific artifact in the W&B App UI or programmatically. You can interactively reference an artifact with the
use_artifactPublic API. A name can contain letters, numbers, underscores, hyphens, and dots. The name must be unique across a project. - type: The artifact’s type. Use the type of an artifact to both organize and differentiate artifacts. You can use any string that contains letters, numbers, underscores, hyphens, and dots. Common types include
datasetormodel. Includemodelwithin your type string if you want to link the artifact to the W&B Model Registry. Note that some types reserved for internal use and cannot be set by users. Such types includejoband types that start withwandb-. - description: A description of the artifact. For Model or Dataset Artifacts, add documentation for your standardized team model or dataset card. View an artifact’s description programmatically with the
Artifact.descriptionattribute or programmatically with the W&B App UI. W&B renders the description as markdown in the W&B App. - metadata: Additional information about an artifact. Specify metadata as a dictionary of key-value pairs. You can specify no more than 100 total keys.
- incremental: Use
Artifact.new_draft()method instead to modify an existing artifact. - use_as: Deprecated.
- storage_region:
Properties:
id
The artifact’s ID.entity
The name of the entity that the artifact collection belongs to. If the artifact is a link, the entity will be the entity of the linked artifact.project
The name of the project that the artifact collection belongs to. If the artifact is a link, the project will be the project of the linked artifact.name
The artifact name and version of the artifact. A string with the format{collection}:{alias}. If fetched before an artifact is
logged/saved, the name won’t contain the alias.
If the artifact is a link, the name will be the name of the linked artifact.
qualified_name
The entity/project/name of the artifact. If the artifact is a link, the qualified name will be the qualified name of the linked artifact path.version
The artifact’s version. A string with the formatv{number}.
If this is a link artifact, the version will be from the linked collection.
collection
The collection this artifact is retrieved from. A collection is an ordered group of artifact versions. If this artifact is retrieved from a collection that it is linked to, return that collection. Otherwise, return the collection that the artifact version originates from. The collection that an artifact originates from is known as the source sequence.source_entity
The name of the entity of the source artifact.source_project
The name of the project of the source artifact.source_name
The artifact name and version of the source artifact. A string with the format{source_collection}:{alias}. Before the artifact
is saved, contains only the name since the version is not yet known.
source_qualified_name
The source_entity/source_project/source_name of the source artifact.source_version
The source artifact’s version. A string with the formatv{number}.
source_collection
The artifact’s source collection. The source collection is the collection that the artifact was logged from.is_link
Boolean flag indicating if the artifact is a link artifact. True: The artifact is a link artifact to a source artifact. False: The artifact is a source artifact.linked_artifacts
Returns a list of all the linked artifacts of a source artifact. If this artifact is a link artifact (artifact.is_link == True),
it will return an empty list.
Limited to 500 results.
source_artifact
Returns the source artifact, which is the original logged artifact. If this artifact is a source artifact (artifact.is_link == False),
it will return itself.
type
The artifact’s type. Common types includedataset or model.
url
Constructs the URL of the artifact.description
A description of the artifact.metadata
User-defined artifact metadata. Structured data associated with the artifact.ttl
The time-to-live (TTL) policy of an artifact. Artifacts are deleted shortly after a TTL policy’s duration passes. If set toNone, the artifact deactivates TTL policies and will be not
scheduled for deletion, even if there is a team default TTL.
An artifact inherits a TTL policy from
the team default if the team administrator defines a default
TTL and there is no custom policy set on an artifact.
Raises:
ArtifactNotLoggedError: Unable to fetch inherited TTL if the
artifact has not been logged or saved.
aliases
List of one or more semantically-friendly references or identifying “nicknames” assigned to an artifact version. Aliases are mutable references that you can programmatically reference. Change an artifact’s alias with the W&B App UI or programmatically. See Create new artifact versions for more information.tags
List of one or more tags assigned to this artifact version.use_as
Deprecated.state
The status of the artifact. One of: “PENDING”, “COMMITTED”, or “DELETED”.manifest
The artifact’s manifest. The manifest lists all of its contents, and can’t be changed once the artifact has been logged.digest
The logical digest of the artifact. The digest is the checksum of the artifact’s contents. If an artifact has the same digest as the currentlatest version, then log_artifact is a no-op.
size
The total size of the artifact in bytes. Includes any references tracked by this artifact.commit_hash
The hash returned when this artifact was committed.file_count
The number of files (including references).created_at
Timestamp when the artifact was created.updated_at
The time when the artifact was last updated.history_step
The nearest step which logged history metrics for this artifact’s source run.Methods:
add
Add wandb.WBValueobj to the artifact.
add_dir
Add a local directory to the artifact.add_file
Add a local file to the artifact.add_reference
Add a reference denoted by a URI to the artifact. Unlike files or directories that you add to an artifact, references are not uploaded to W&B. For more information, see Track external files. By default, the following schemes are supported:- http(s): The size and digest of the file will be inferred by the
Content-Lengthand theETagresponse headers returned by the server. - s3: The checksum and size are pulled from the object metadata. If bucket versioning is enabled, then the version ID is also tracked.
- gs: The checksum and size are pulled from the object metadata. If bucket versioning is enabled, then the version ID is also tracked.
- https, domain matching
*.blob.core.windows.net - Azure: The checksum and size are be pulled from the blob metadata. If storage account versioning is enabled, then the version ID is also tracked.
- file: The checksum and size are pulled from the file system. This scheme is useful if you have an NFS share or other externally mounted volume containing files you wish to track but not necessarily upload.
checkout
Replace the specified root directory with the contents of the artifact. WARNING: This will delete all files inroot that are not included in the
artifact.
delete
Delete an artifact and its files. If called on a linked artifact, only the link is deleted, and the source artifact is unaffected. UseArtifact.unlink() instead of Artifact.delete() to remove a
link between a source artifact and a collection.
download
Download the contents of the artifact to the specified root directory. Existing files located withinroot are not modified. Explicitly delete root
before you call download if you want the contents of root to exactly match
the artifact.
file
Download a single file artifact to the directory you specify withroot.
files
Iterate over all files stored in this artifact.finalize
Finalize the artifact version. You cannot modify an artifact version once it is finalized because the artifact is logged as a specific artifact version. Create a new artifact version to log more data to an artifact. An artifact is automatically finalized when you log the artifact withlog_artifact.
get
Get the WBValue object located at the artifact relativename.
get_added_local_path_name
Get the artifact relative name of a file added by a local filesystem path.get_entry
Get the entry with the given name.get_path
Deprecated. Useget_entry(name).