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

Method upload_meta

modelscope/msdatasets/ms_dataset.py:470–506  ·  view source on GitHub ↗

Upload meta-file of dataset to the ModelScope Hub. Please clone the meta-data from the ModelScope Hub first. Args: dataset_work_dir (str): Current working directory. commit_message (str): Commit message. revision(`Optional[str]`): revision

(dataset_work_dir: str,
                    commit_message: str,
                    revision: Optional[str] = DEFAULT_DATASET_REVISION,
                    auth_token: Optional[str] = None,
                    git_path: Optional[str] = None,
                    force: bool = False)

Source from the content-addressed store, hash-verified

468
469 @staticmethod
470 def upload_meta(dataset_work_dir: str,
471 commit_message: str,
472 revision: Optional[str] = DEFAULT_DATASET_REVISION,
473 auth_token: Optional[str] = None,
474 git_path: Optional[str] = None,
475 force: bool = False) -> None:
476 """Upload meta-file of dataset to the ModelScope Hub. Please clone the meta-data from the ModelScope Hub first.
477
478 Args:
479 dataset_work_dir (str): Current working directory.
480 commit_message (str): Commit message.
481 revision(`Optional[str]`):
482 revision of the model you want to clone from. Can be any of a branch, tag or commit hash
483 auth_token(`Optional[str]`):
484 token obtained when calling `HubApi.login()`. Usually you can safely ignore the parameter
485 as the token is already saved when you log in the first time, if None, we will use saved token.
486 git_path:(`Optional[str]`):
487 The git command line path, if None, we use 'git'
488 force (Optional[bool]): whether to use forced-push.
489
490 Returns:
491 None
492
493 """
494 warnings.warn(
495 'The function `upload_meta` is deprecated, '
496 'please use git command '
497 'or CLI `modelscope upload owner_name/repo_name ...`.',
498 DeprecationWarning)
499
500 _repo = DatasetRepository(
501 repo_work_dir=dataset_work_dir,
502 dataset_id='',
503 revision=revision,
504 auth_token=auth_token,
505 git_path=git_path)
506 _repo.push(commit_message=commit_message, branch=revision, force=force)
507
508 @staticmethod
509 def delete(object_name: str,

Callers

nothing calls this directly

Calls 2

pushMethod · 0.95
DatasetRepositoryClass · 0.90

Tested by

no test coverage detected