š DataChain Open-Source Release. Star us on !
Clones MLEM Object from path
to out
and
returns Python representation for the created object.
def clone(
path: str,
target: str,
project: Optional[str] = None,
rev: Optional[str] = None,
fs: Optional[AbstractFileSystem] = None,
target_project: Optional[str] = None,
target_fs: Optional[str] = None,
follow_links: bool = True,
load_value: bool = False,
) -> MlemObject
from mlem.api import clone
cloned_obj = clone(path="rf", target="mymodel", project="https://github.com/iterative/example-mlem-get-started", rev="main")
This API is the underlying mechanism for the mlem clone command and facilitates copying of a MLEM Object from source to target.
path
(required) - Path to the object. Could be local path or path inside
a git repo.target
(required) - Path to save the copy of initial object to.project
(optional) - URL to project if object is located there.rev
(optional) - revision, could be git commit SHA, branch name or tag.fs
(optional) - filesystem to load object fromtarget_project
(optional) - path to project to save cloned object totarget_fs
(optional) - target filesystemfollow_links
(optional) - If object we read is a MLEM link, whether to
loadthe actual object link points to. Defaults to True.load_value
(optional) - Load actual python object incorporated in
MlemObject. Defaults to False.MlemObject
: Copy of initial object saved to out
.
None
from mlem.api import clone
cloned_obj = clone(path="rf", target="mymodel", project="https://github.com/iterative/example-mlem-get-started", rev="main", target_project="s3://mybucket/mymodel", load_value=True)