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

Function upload_file

modelscope/utils/hf_util/patcher.py:802–818  ·  view source on GitHub ↗
(
        self,
        *,
        path_or_fileobj: Union[str, Path, bytes, BinaryIO],
        path_in_repo: str,
        repo_id: str,
        token: Union[str, bool, None] = None,
        revision: Optional[str] = DEFAULT_REPOSITORY_REVISION,
        commit_message: Optional[str] = None,
        commit_description: Optional[str] = None,
        **kwargs,
    )

Source from the content-addressed store, hash-verified

800
801 @future_compatible
802 def upload_file(
803 self,
804 *,
805 path_or_fileobj: Union[str, Path, bytes, BinaryIO],
806 path_in_repo: str,
807 repo_id: str,
808 token: Union[str, bool, None] = None,
809 revision: Optional[str] = DEFAULT_REPOSITORY_REVISION,
810 commit_message: Optional[str] = None,
811 commit_description: Optional[str] = None,
812 **kwargs,
813 ):
814 if revision is None or revision == 'main':
815 revision = 'master'
816 from modelscope.hub.push_to_hub import _push_files_to_hub
817 _push_files_to_hub(path_or_fileobj, path_in_repo, repo_id, token,
818 revision, commit_message, commit_description)
819
820 @future_compatible
821 def create_commit(

Callers 1

Calls 1

_push_files_to_hubFunction · 0.90

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…