You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HfFileSystem.url() returns a wrong folder URL when the repo id contains 'resolve' #5172
HfFileSystem.url() builds the URL of a directory by replacing the first /resolve/ in the file URL with /tree/. When the namespace or the repo name is literally resolve, that first occurrence is part of the repo id, not the route, so the link points to a different repo.
Reproduction
fromhuggingface_hubimportHfFileSystemfs=HfFileSystem()
fs.url("my-org/resolve/data") # "data" is a folder# -> https://huggingface.co/my-org/tree/resolve/main/data (wrong)# expected https://huggingface.co/my-org/resolve/tree/main/data
The same happens for a namespace named resolve (resolve/my-model/folder), for datasets, and for buckets.
Logs
No response
System info
huggingface_hub main (version = "2.3.0.dev0"). The cause is url.replace("/resolve/", "/tree/", 1) in hf_file_system.py. Only rewriting the part after the repo/bucket base URL fixes it. I have a small PR with a regression test ready.
Activity