[Python] How to convert safetensors model to onnx model?

Discussão em 'Python' iniciado por Stack, Abril 23, 2025.

  1. Stack

    Stack Membro Participativo

    I want to convert a model.safetensors to ONNX, unfortunately I haven't found enough information about the procedure. The documentation of safetensors package isn't enough and actually is not clear even how to get the original (pytorch in my case) model, since when I try something as

    with st.safe_open(modelsafetensors, framework="pt") as mystf:
    ...


    the mystf object has get_tensor('sometensorname') but it seems hasn't any get_model() method or something similar.

    Continue reading...

Compartilhe esta Página