Hugging Face

Convert Transformers to ONNX with Hugging Face Optimum

Jun 22, 2022
Convert Transformers to ONNX with Hugging Face Optimum
SummaryAI, from the source post

This post details how to convert Hugging Face Transformers models to the ONNX format using the Hugging Face Optimum library. It explains the benefits of ONNX for deployment and provides three methods for conversion: low-level `torch.onnx.export`, mid-level `transformers.onnx.export`, and high-level `optimum.onnxruntime.ORTModelForXxx.from_pretrained`. It also lists supported architectures and suggests next steps like accelerated inference, quantization, and training with ONNX.

More from the IPU-Ready Transformers Optimization trail