jdumke
(Jonathan)
1
Hello all,
I’m going fully bananas by reading tons of documentation [1, 2] and many more.
The point of struggle is extracting the state_dict from the safetensors file with the checkpoint.
I can load the data from the file in many variants, but none of these leads a step further and let me extract the desired parts.
Could somebody give me a description of a typical workflow?
Greets,
Jonathan
[1] Tranformers Executorch preexporter
[2] Executorch docs
lucylq
(Lucy)
2
Hi Jonathan, thanks for trying out executorch!
Could you help me understand what you’re trying to do? Are you trying to export a model to executorch, with weights in a safetensors file?
lucylq
(Lucy)
3
I guess a typical workflow is:
- Take an eager model (nn.Module, or model from Huggingface)
- Export it using torch.export.export
- Lower it to edge dialect (to_edge), and potentially lower to a hardware backend for performance (to_backend)
- Serialize it to executorch (to_executorch) and save.
This will create the model artifact.
Then, we can run the model in pybindings, or build the C++ runtime and run it there.