CoolFace
Apppublic

Shalubu/convert-to-onnx

sourceHugging Faceapache-2.0updated 10mo agoView on Hugging Face
0likes
App README

Convert to ONNX

Overview

This project provides a Streamlit application that facilitates the conversion of Hugging Face models to ONNX format, downloading, converting, and uploading models to Hugging Face.

Docker Compose usage

1. Prepare environment variables

Copy the provided template and fill in your Hugging Face write token:

bash
cp .env.example .env

2. Start the application

bash
docker compose up

Access the interface at http://localhost:8501.

Enter a Hugging Face model ID (e.g., EleutherAI/pythia-14m).

After a successful conversion, the ONNX export is available under {username}/{model-name}-ONNX unless you opt into reusing the same repository.

To stop the service, press Ctrl+C (or run docker compose down). Add -d to run detached.

Direct Docker usage (optional)

If you prefer not to use Docker Compose, you can still build and run manually:

bash
docker build -t convert-to-onnx .

docker run --rm \
  -p 8501:8501 \
  -e HF_TOKEN="your_write_token" \
  convert-to-onnx

Development

Contributing

  1. 1.Fork the repository
  2. 2.Create a feature branch
  3. 3.Implement changes with tests
  4. 4.Submit a pull request

Troubleshooting

Common issues and solutions:

  • Authentication Errors: Verify your Hugging Face credentials
  • Conversion Failures: Check model compatibility and available disk space
  • Upload Issues: Ensure stable internet connection and valid permissions

License

Apache 2.0 License