Zarxrax commited on
Commit
cf1ca14
·
verified ·
1 Parent(s): ff190ea

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +4 -9
  2. requirements.txt +1 -0
app.py CHANGED
@@ -196,20 +196,15 @@ with gr.Blocks(title="PTH to ONNX Converter") as demo:
196
  install()
197
  spandrel_extra_arches.install()
198
 
199
- gr.Textbox(value="This tool is still in development. Outputs may be incorrect.", label="Notice")
200
- # with gr.Accordion("Model Cheat Sheet", open=False):
201
- # gr.Markdown("""
202
- # After converting a model, be sure to click the log button above to check the output for any errors or warnings.
203
- # """)
204
-
205
  file_upload = gr.File(label="Upload a PyTorch model", file_types=['.pth', '.pt', '.safetensors'])
206
  metadata = gr.Textbox(value="Ready", label="File Information")
207
 
208
  dropdown_opset = gr.Dropdown(choices=[17, 18, 19, 20], value=20, label="Opset")
209
- radio_fp16 = gr.Radio(choices=["True", "False"], value="False", label="FP16 - Export at half precision. Not supported by all models.")
210
- radio_static = gr.Radio(choices=["True", "False"], value="False", label="Static Shapes - Some models may work better with static shapes. You may need to try both options.")
211
- radio_slim = gr.Radio(choices=["True", "False"], value="False", label="OnnxSlim - Can potentially optimize the model further, but usually has little effect and can cause the model to not work correctly.")
212
 
 
213
  process_button = gr.Button("Convert", interactive=True)
214
  file_output = gr.DownloadButton(label="💾 Download Converted Model", visible=False)
215
 
 
196
  install()
197
  spandrel_extra_arches.install()
198
 
 
 
 
 
 
 
199
  file_upload = gr.File(label="Upload a PyTorch model", file_types=['.pth', '.pt', '.safetensors'])
200
  metadata = gr.Textbox(value="Ready", label="File Information")
201
 
202
  dropdown_opset = gr.Dropdown(choices=[17, 18, 19, 20], value=20, label="Opset")
203
+ radio_fp16 = gr.Radio(choices=["True", "False"], value="False", label="FP16 - Not supported by all models. Not very useful because FP16 TRT engines can still be built from FP32 ONNX models.")
204
+ radio_static = gr.Radio(choices=["True", "False"], value="False", label="Static Shapes - Might be required by some models, but can cause slower performance.")
205
+ radio_slim = gr.Radio(choices=["True", "False"], value="False", label="OnnxSlim - Can cause issues in some models. I have not yet found any cases where it helps. May remove in the future.")
206
 
207
+ gr.Markdown("After converting, click the logs button at the top to check for any errors or warnings.")
208
  process_button = gr.Button("Convert", interactive=True)
209
  file_output = gr.DownloadButton(label="💾 Download Converted Model", visible=False)
210
 
requirements.txt CHANGED
@@ -1,6 +1,7 @@
1
  spandrel>=0.4.1
2
  spandrel-extra-arches>=0.2.0
3
  torch>=2.7.1
 
4
  gradio
5
  onnx
6
  onnxruntime
 
1
  spandrel>=0.4.1
2
  spandrel-extra-arches>=0.2.0
3
  torch>=2.7.1
4
+ numpy==2.2.6
5
  gradio
6
  onnx
7
  onnxruntime