@@ -5032,8 +5032,8 @@ def create_commit(
50325032 To disable authentication, pass `False`.
50335033
50345034 repo_type (`str`, *optional*):
5035- Set to `"dataset"` or `"space "` if uploading to a dataset or
5036- space, `None` or `"model"` if uploading to a model. Default is
5035+ Set to `"dataset"`, `"space"` or `"kernel "` if uploading to a dataset,
5036+ space or kernel repo , `None` or `"model"` if uploading to a model. Default is
50375037 `None`.
50385038
50395039 revision (`str`, *optional*):
@@ -5102,8 +5102,8 @@ def create_commit(
51025102
51035103 commit_description = commit_description if commit_description is not None else ""
51045104 repo_type = repo_type if repo_type is not None else constants.REPO_TYPE_MODEL
5105- if repo_type not in constants.REPO_TYPES :
5106- raise ValueError(f"Invalid repo type, must be one of {constants.REPO_TYPES }")
5105+ if repo_type not in constants.REPO_TYPES_WITH_KERNEL :
5106+ raise ValueError(f"Invalid repo type, must be one of {constants.REPO_TYPES_WITH_KERNEL }")
51075107 unquoted_revision = revision or constants.DEFAULT_REVISION
51085108 revision = quote(unquoted_revision, safe="")
51095109 create_pr = create_pr if create_pr is not None else False
@@ -5308,7 +5308,7 @@ def preupload_lfs_files(
53085308 To disable authentication, pass `False`.
53095309
53105310 repo_type (`str`, *optional*):
5311- The type of repository to upload to (e.g. `"model"` -default-, `"dataset"` or `"space "`).
5311+ The type of repository to upload to (e.g. `"model"` -default-, `"dataset"`, `"space"` or `"kernel "`).
53125312
53135313 revision (`str`, *optional*):
53145314 The git revision to commit from. Defaults to the head of the `"main"` branch.
@@ -5353,8 +5353,8 @@ def preupload_lfs_files(
53535353 from ._commit_api import _fetch_upload_modes, _upload_files
53545354
53555355 repo_type = repo_type if repo_type is not None else constants.REPO_TYPE_MODEL
5356- if repo_type not in constants.REPO_TYPES :
5357- raise ValueError(f"Invalid repo type, must be one of {constants.REPO_TYPES }")
5356+ if repo_type not in constants.REPO_TYPES_WITH_KERNEL :
5357+ raise ValueError(f"Invalid repo type, must be one of {constants.REPO_TYPES_WITH_KERNEL }")
53585358 revision = quote(revision, safe="") if revision is not None else constants.DEFAULT_REVISION
53595359 create_pr = create_pr if create_pr is not None else False
53605360 headers = self._build_hf_headers(token=token)
@@ -5476,8 +5476,8 @@ def _duplicate_lfs_files(
54765476 from ._commit_api import DUPLICATE_LFS_BATCH_SIZE, _CopySource
54775477
54785478 repo_type = repo_type if repo_type is not None else constants.REPO_TYPE_MODEL
5479- if repo_type not in constants.REPO_TYPES :
5480- raise ValueError(f"Invalid repo type, must be one of {constants.REPO_TYPES }")
5479+ if repo_type not in constants.REPO_TYPES_WITH_KERNEL :
5480+ raise ValueError(f"Invalid repo type, must be one of {constants.REPO_TYPES_WITH_KERNEL }")
54815481 headers = self._build_hf_headers(token=token)
54825482
54835483 copies = list(copies)
@@ -5614,8 +5614,8 @@ def upload_file(
56145614 https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
56155615 To disable authentication, pass `False`.
56165616 repo_type (`str`, *optional*):
5617- Set to `"dataset"` or `"space "` if uploading to a dataset or
5618- space, `None` or `"model"` if uploading to a model. Default is
5617+ Set to `"dataset"`, `"space"` or `"kernel "` if uploading to a dataset,
5618+ space or kernel repo , `None` or `"model"` if uploading to a model. Default is
56195619 `None`.
56205620 revision (`str`, *optional*):
56215621 The git revision to commit from. Defaults to the head of the `"main"` branch.
@@ -5698,8 +5698,8 @@ def upload_file(
56985698
56995699 from ._commit_api import CommitOperationAdd
57005700
5701- if repo_type not in constants.REPO_TYPES :
5702- raise ValueError(f"Invalid repo type, must be one of {constants.REPO_TYPES }")
5701+ if repo_type not in constants.REPO_TYPES_WITH_KERNEL :
5702+ raise ValueError(f"Invalid repo type, must be one of {constants.REPO_TYPES_WITH_KERNEL }")
57035703
57045704 commit_message = (
57055705 commit_message if commit_message is not None else f"Upload {path_in_repo} with huggingface_hub"
@@ -5825,8 +5825,8 @@ def upload_folder(
58255825 https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
58265826 To disable authentication, pass `False`.
58275827 repo_type (`str`, *optional*):
5828- Set to `"dataset"` or `"space "` if uploading to a dataset or
5829- space, `None` or `"model"` if uploading to a model. Default is
5828+ Set to `"dataset"`, `"space"` or `"kernel "` if uploading to a dataset,
5829+ space or kernel repo , `None` or `"model"` if uploading to a model. Default is
58305830 `None`.
58315831 revision (`str`, *optional*):
58325832 The git revision to commit from. Defaults to the head of the `"main"` branch.
@@ -5913,8 +5913,8 @@ def upload_folder(
59135913 ... )
59145914 ```
59155915 """
5916- if repo_type not in constants.REPO_TYPES :
5917- raise ValueError(f"Invalid repo type, must be one of {constants.REPO_TYPES }")
5916+ if repo_type not in constants.REPO_TYPES_WITH_KERNEL :
5917+ raise ValueError(f"Invalid repo type, must be one of {constants.REPO_TYPES_WITH_KERNEL }")
59185918 if create_pr and revision is not None and revision != constants.DEFAULT_REVISION:
59195919 raise ValueError(
59205920 f"Cannot use `create_pr=True` with `revision='{revision}'`: pull requests created by"
0 commit comments