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

SafetensorError does not appear in __init__.pyi #523

Open
2 tasks
alanhdu opened this issue Aug 26, 2024 · 1 comment
Open
2 tasks

SafetensorError does not appear in __init__.pyi #523

alanhdu opened this issue Aug 26, 2024 · 1 comment

Comments

@alanhdu
Copy link

alanhdu commented Aug 26, 2024

System Info

Python 3.10, safetensors 0.4.4

Information

  • The official example scripts
  • My own modified scripts

Reproduction

If you try to use a type-checker with safetensors, you will get errors about how safetensors.SafetensorError does not exist. I believe this is because the error is missing from https://github.com/huggingface/safetensors/blob/main/bindings/python/py_src/safetensors/__init__.pyi#L1.

I'd be happy to add an exception there, but the file says its autogenerated so presumably we should be modifying the generation step? Not sure exactly how that works.

Expected behavior

SafetensorError appears in the .pyi file so it can be used by typecheckers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@alanhdu and others