MCPcopy Create free account
hub / github.com/modelscope/modelscope / clone

Method clone

modelscope/hub/git.py:112–128  ·  view source on GitHub ↗
(self,
              repo_base_dir: str,
              git_token: Optional[str],
              url: str,
              repo_name: str,
              branch: Optional[str] = None)

Source from the content-addressed store, hash-verified

110 # Clone / pull / push
111 # ------------------------------------------------------------------
112 def clone(self,
113 repo_base_dir: str,
114 git_token: Optional[str],
115 url: str,
116 repo_name: str,
117 branch: Optional[str] = None):
118 target = Path(repo_base_dir) / repo_name
119 try:
120 _GitCommand.clone(
121 url=url, target_dir=target, branch=branch, token=git_token)
122 except Exception as exc:
123 if (target / '.git').is_dir():
124 logger.warning(
125 'git clone exited non-zero but repository was cloned '
126 'at %s. Likely a post-clone hook. Continuing.', target)
127 return None
128 raise GitError(str(exc)) from exc
129
130 def pull(self,
131 repo_dir: str,

Callers 15

check_ddp_consistencyFunction · 0.45
_split_checkpointFunction · 0.45
_merge_checkpointFunction · 0.45
prune_linear_layerFunction · 0.45
_tie_or_clone_weightsFunction · 0.45
spec_augFunction · 0.45
xyn2xyFunction · 0.45
forwardMethod · 0.45
forwardMethod · 0.45
__call__Method · 0.45
forwardMethod · 0.45
process_imageMethod · 0.45

Calls 1

GitErrorClass · 0.90

Tested by

no test coverage detected