huggingface / safetensors

Simple, safe way to store and distribute tensors
https://huggingface.co/docs/safetensors
Apache License 2.0
2.79k stars 189 forks source link

misleading error message in `safe_open` #485

Closed Clement-Lelievre closed 2 months ago

Clement-Lelievre commented 3 months ago

System Info

safetensors 0.4.3

Information

Reproduction

  1. mkdir some_folder/
  2. safe_open("some_folder", "pt")

this produces the error OSError: No such device (os error 19)

Expected behavior

instead of an error mentioning a missing device, it should say that the path passed does not point to a safetensors file, or am I missing something?

julien-c commented 3 months ago

thanks for reporting @Clement-Lelievre

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

lonngxiang commented 2 months ago

same error

jiahuanluo commented 1 month ago

It appears that safetensors model files stored in certain mounted directories, such as Ceph, may encounter this issue. Copying the model to the local hard drive (" ~/ ") allows it to load correctly. Additionally, saving it as a .bin model file does not encounter this issue. Maybe the same problem here