This project provides a Streamlit application that converts Hugging Face models to ONNX (Open Neural Network Exchange) format, enabling broader model compatibility and deployment options. The application streamlines the process of downloading, converting, and uploading models to Hugging Face.
- One-Click Model Conversion: Convert Hugging Face models to ONNX format with minimal configuration
- User-Friendly Interface: Intuitive Streamlit-based web interface
- Quantization Support: Automatic model quantization for reduced size and faster inference
- Docker and Docker Compose
- Hugging Face account and API token
-
Create a
.streamlit
directory. -
Inside of the
.streamlit
directory, create asecrets.toml
file. -
Inside of the
secrets.toml
file, add a line with your Hugging Face write access API token:HF_TOKEN="yourToken"
. -
Run the docker-compose.yml.
services: convert_to_onnx: image: ghcr.io/doppeltilde/convert_to_onnx:latest ports: - "8501:8501" volumes: - ./models:/root/.cache/huggingface/hub:rw environment: - HF_TOKEN restart: unless-stopped
-
Access the web interface at
http://localhost:8501
-
Enter a Hugging Face model ID (e.g.,
EleutherAI/pythia-14m
) -
Click "Proceed" to start the conversion
The converted model will be available in your Hugging Face account as {username}/{model-name}-ONNX
.