Skip to content

SafetensorError isn't pickle-able, it should be (smoke test for issue import of module 'safetensors_rust' failed) #684

@doctorpangloss

Description

@doctorpangloss

System Info

(transformers-cli env breaks with jax issues right now, so here's the relevant version)

safetensors==0.7.0

Information

  • The official example scripts
  • My own modified scripts

Reproduction

from safetensors import SafetensorError
import pickle
pickle.dumps(SafetensorError())

fails with

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
_pickle.PicklingError: Can't pickle <class 'safetensors_rust.SafetensorError'>: import of module 'safetensors_rust' failed

Expected behavior

many integrations expect errors to be picklable or serializable. they don't have to be, but they reduce pain everywhere when they are.

another POV is this is probably a smoke test for a deeper issue that may be relevant

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