push_to_hub

class swift.hub.push_to_hub.push_to_hub(repo_name, output_dir, token=None, private=True, retry=3, commit_message='', tag=None, source_repo='', ignore_file_pattern=None, revision='master')[source]
Parameters:
  • repo_name – The repo name for the modelhub repo

  • output_dir – The local output_dir for the checkpoint

  • token – The user api token, function will check the MODELSCOPE_API_TOKEN variable if this argument is None

  • private – If is a private repo, default True

  • retry – Retry times if something error in uploading, default 3

  • commit_message – The commit message

  • tag – The tag of this commit

  • source_repo – The source repo (model id) which this model comes from

  • ignore_file_pattern – The file pattern to be ignored in uploading.

  • revision – The branch to commit to

Returns:

The boolean value to represent whether the model is uploaded.