Skip to content

SafetensorError does not appear in __init__.pyi #523

@alanhdu

Description

@alanhdu

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions