Skip to content

Commit

Permalink
add destination path to client artifacts download (mlflow#1504)
Browse files Browse the repository at this point in the history
  • Loading branch information
LizaShak authored and aarondav committed Jun 26, 2019
1 parent 4270802 commit b0836f8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mlflow/tracking/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,19 +234,24 @@ def list_artifacts(self, run_id, path=None):
artifact_repo = get_artifact_repository(artifact_root)
return artifact_repo.list_artifacts(path)

def download_artifacts(self, run_id, path):
def download_artifacts(self, run_id, path, dst_path=None):
"""
Download an artifact file or directory from a run to a local directory if applicable,
and return a local path for it.
:param run_id: The run to download artifacts from.
:param path: Relative source path to the desired artifact.
:param dst_path: Absolute path of the local filesystem destination directory to which to
download the specified artifacts. This directory must already exist.
If unspecified, the artifacts will either be downloaded to a new
uniquely-named directory on the local filesystem or will be returned
directly in the case of the LocalArtifactRepository.
:return: Local path of desired artifact.
"""
run = self.get_run(run_id)
artifact_root = run.info.artifact_uri
artifact_repo = get_artifact_repository(artifact_root)
return artifact_repo.download_artifacts(path)
return artifact_repo.download_artifacts(path, dst_path)

def set_terminated(self, run_id, status=None, end_time=None):
"""Set a run's status to terminated.
Expand Down

0 comments on commit b0836f8

Please sign in to comment.