Check out our new VS Code extension for experiment tracking and model development
Clones MLEM object from path
to target
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,
index: bool = None,
external: bool = None,
) -> 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 load
the actual object link points to. Defaults to True.load_value
(optional) - Load actual python object incorporated in MlemMeta
object. Defaults to False.index
(optional) - Whether to index output in .mlem directoryexternal
(optional) - whether to put object inside mlem dir in target
projectNone
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)