Skip to content

Commit

Permalink
(nit) fix fsspec default mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Wauplin committed Nov 8, 2023
1 parent 1ecb1ac commit 18d0ae2
Showing 1 changed file with 1 addition and 2 deletions.
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 @@ -414,11 +414,10 @@ def __init__(self, fs: HfFileSystem, path: str, revision: Optional[str] = None,
super().__init__(fs, path, **kwargs)
self.fs: HfFileSystem

mode = kwargs.get("mode", "r")
try:
self.resolved_path = fs.resolve_path(path, revision=revision)
except FileNotFoundError as e:
if "w" in mode:
if "w" in kwargs.get("mode", ""):
raise FileNotFoundError(
f"{e}.\nMake sure the repository and revision exist before writing data."
) from e
Expand Down

0 comments on commit 18d0ae2

Please sign in to comment.