Skip to content

Commit c8bbf54

Browse files
authored
Fix revision bug in _upload_large_folder.py (#2879)
1 parent b620a86 commit c8bbf54

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/huggingface_hub/_upload_large_folder.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from pathlib import Path
2626
from threading import Lock
2727
from typing import TYPE_CHECKING, List, Optional, Tuple, Union
28+
from urllib.parse import quote
2829

2930
from . import constants
3031
from ._commit_api import CommitOperationAdd, UploadInfo, _fetch_upload_modes
@@ -497,7 +498,7 @@ def _get_upload_mode(items: List[JOB_ITEM_T], api: "HfApi", repo_id: str, repo_t
497498
repo_type=repo_type,
498499
repo_id=repo_id,
499500
headers=api._build_hf_headers(),
500-
revision=revision,
501+
revision=quote(revision, safe=""),
501502
)
502503
for item, addition in zip(items, additions):
503504
paths, metadata = item

0 commit comments

Comments
 (0)