Felladrin commited on
Commit
f2501ef
·
verified ·
1 Parent(s): 1364cbe

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +86 -2
README.md CHANGED
@@ -4,10 +4,94 @@ emoji: ☯
4
  colorFrom: indigo
5
  colorTo: yellow
6
  sdk: streamlit
7
- sdk_version: 1.31.1
8
  app_file: app.py
9
  pinned: true
10
  license: apache-2.0
11
  header: mini
12
- short_description: Convert a HuggingFace model to ONNX format
13
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  colorFrom: indigo
5
  colorTo: yellow
6
  sdk: streamlit
7
+ sdk_version: 1.40.1
8
  app_file: app.py
9
  pinned: true
10
  license: apache-2.0
11
  header: mini
12
+ short_description: Convert a Hugging Face model to ONNX format
13
  ---
14
+
15
+ # Convert to ONNX
16
+
17
+ ## Overview
18
+
19
+ 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.
20
+
21
+ ## Features
22
+
23
+ - **One-Click Model Conversion**: Convert Hugging Face models to ONNX format with minimal configuration
24
+ - **Automatic Repository Management**: Seamless handling of required dependencies
25
+ - **Comprehensive Error Handling**: Clear feedback throughout the conversion process
26
+ - **User-Friendly Interface**: Intuitive Streamlit-based web interface
27
+ - **Quantization Support**: Automatic model quantization for reduced size and faster inference
28
+
29
+ ## Prerequisites
30
+
31
+ - Python 3.8+
32
+ - Hugging Face account and API token
33
+ - Git
34
+
35
+ ## Installation
36
+
37
+ 1. Clone the repository:
38
+
39
+ ```bash
40
+ git clone https://huggingface.co/spaces/onnx-community/convert-to-onnx
41
+ cd convert-to-onnx
42
+ ```
43
+
44
+ 2. Install dependencies:
45
+
46
+ ```bash
47
+ pip install -r requirements.txt
48
+ ```
49
+
50
+ 3. Configure Hugging Face credentials:
51
+
52
+ ```bash
53
+ # Option 1: Environment variables
54
+ export HF_TOKEN="your_token"
55
+ export HF_USERNAME="your_username"
56
+
57
+ # Option 2: Create .streamlit/secrets.toml
58
+ echo 'HF_TOKEN = "your_token"' > .streamlit/secrets.toml
59
+ echo 'HF_USERNAME = "your_username"' >> .streamlit/secrets.toml
60
+ ```
61
+
62
+ ## Usage
63
+
64
+ 1. Start the application:
65
+
66
+ ```bash
67
+ streamlit run app.py
68
+ ```
69
+
70
+ 2. Access the web interface at `http://localhost:8501`
71
+
72
+ 3. Enter a Hugging Face model ID (e.g., `EleutherAI/pythia-14m`)
73
+
74
+ 4. Click "Proceed" to start the conversion
75
+
76
+ The converted model will be available in your Hugging Face account as `{username}/{model-name}-ONNX`.
77
+
78
+ ## Development
79
+
80
+ ### Contributing
81
+
82
+ 1. Fork the repository
83
+ 2. Create a feature branch
84
+ 3. Implement changes with tests
85
+ 4. Submit a pull request
86
+
87
+ ## Troubleshooting
88
+
89
+ Common issues and solutions:
90
+
91
+ - **Authentication Errors**: Verify your Hugging Face credentials
92
+ - **Conversion Failures**: Check model compatibility and available disk space
93
+ - **Upload Issues**: Ensure stable internet connection and valid permissions
94
+
95
+ ## License
96
+
97
+ [Apache 2.0 License](license.txt)