Export transformers model to ONNX with HF Optimum exporters.

This Space enables automatic export of Hugging Face transformers PyTorch models to ONNX. It creates a pull request on the target model repository, allowing model owners to review and merge the ONNX export, making their models accessible across a wide range of devices and platforms.

Once exported, the model can be seamlessly integrated with HF Optimum, maintaining compatibility with the transformers API. For detailed implementation, check out this comprehensive guide.

Quick Start Guide:

  1. Obtain a read-access token from https://huggingface.co/settings/tokens (read access is sufficient for PR creation)
  2. Enter a model ID from the Hub (e.g., textattack/distilbert-base-cased-CoLA)
  3. Click "Export to ONNX"
  4. Done! You'll receive feedback on the export status and, if successful, the URL of the created pull request

Important Note: For models exceeding 2 GB, the ONNX export will be saved in an onnx/ subfolder. When loading such models with Optimum, remember to include the subfolder="onnx" parameter.