Workflow for lowerimg a checkpoint from civitai

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

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?

I guess a typical workflow is:

  1. Take an eager model (nn.Module, or model from Huggingface)
  2. Export it using torch.export.export
  3. Lower it to edge dialect (to_edge), and potentially lower to a hardware backend for performance (to_backend)
  4. 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.