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

Method clone_meta

modelscope/msdatasets/ms_dataset.py:431–467  ·  view source on GitHub ↗

Clone meta-file of dataset from the ModelScope Hub. Args: dataset_work_dir (str): Current git working directory. dataset_id (str): Dataset id, in the form of your-namespace/your-dataset-name . revision (str, optional): revision of the mode

(dataset_work_dir: str,
                   dataset_id: str,
                   revision: Optional[str] = DEFAULT_DATASET_REVISION,
                   auth_token: Optional[str] = None,
                   git_path: Optional[str] = None)

Source from the content-addressed store, hash-verified

429
430 @staticmethod
431 def clone_meta(dataset_work_dir: str,
432 dataset_id: str,
433 revision: Optional[str] = DEFAULT_DATASET_REVISION,
434 auth_token: Optional[str] = None,
435 git_path: Optional[str] = None) -> None:
436 """Clone meta-file of dataset from the ModelScope Hub.
437
438 Args:
439 dataset_work_dir (str): Current git working directory.
440 dataset_id (str): Dataset id, in the form of your-namespace/your-dataset-name .
441 revision (str, optional):
442 revision of the model you want to clone from. Can be any of a branch, tag or commit hash
443 auth_token (str, optional):
444 token obtained when calling `HubApi.login()`. Usually you can safely ignore the parameter
445 as the token is already saved when you login the first time, if None, we will use saved token.
446 git_path (str, optional):
447 The git command line path, if None, we use 'git'
448 Returns:
449 None
450 """
451
452 warnings.warn(
453 'The function `clone_meta` is deprecated, please use git command line to clone the repo.',
454 DeprecationWarning)
455
456 _repo = DatasetRepository(
457 repo_work_dir=dataset_work_dir,
458 dataset_id=dataset_id,
459 revision=revision,
460 auth_token=auth_token,
461 git_path=git_path)
462 clone_work_dir = _repo.clone()
463 if clone_work_dir:
464 logger.info('Already cloned repo to: {}'.format(clone_work_dir))
465 else:
466 logger.warning(
467 'Repo dir already exists: {}'.format(clone_work_dir))
468
469 @staticmethod
470 def upload_meta(dataset_work_dir: str,

Callers

nothing calls this directly

Calls 3

cloneMethod · 0.95
DatasetRepositoryClass · 0.90
infoMethod · 0.80

Tested by

no test coverage detected