Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HfFileSystem] Fix rm on branch #1957

Merged
merged 3 commits into from
Jan 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/huggingface_hub/hf_file_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,8 @@ def rm(
**kwargs,
) -> None:
resolved_path = self.resolve_path(path, revision=revision)
root_path = REPO_TYPES_URL_PREFIXES.get(resolved_path.repo_type, "") + resolved_path.repo_id
paths = self.expand_path(path, recursive=recursive, maxdepth=maxdepth, revision=revision)
paths_in_repo = [path[len(root_path) + 1 :] for path in paths if not self.isdir(path)]
paths_in_repo = [self.resolve_path(path).path_in_repo for path in paths if not self.isdir(path)]
operations = [CommitOperationDelete(path_in_repo=path_in_repo) for path_in_repo in paths_in_repo]
commit_message = f"Delete {path} "
commit_message += "recursively " if recursive else ""
Expand Down
Loading