Spaces:
Running
on
Zero
Running
on
Zero
import gradio as gr | |
from convert import convert | |
DESCRIPTION = """ | |
The steps are the following: | |
- Create a new model repo for the converted model if you do not already have one. | |
- Paste a read-access token in the your_hf_token box from hf.co/settings/tokens. Read access is enough given that we will open a PR against your created repo. | |
- Input a model id (username/repo) which can be put in clipboard by clicking the copy icon ⧉ next to the title of the repo then paste in the model_id box. | |
- Input the filename from the root dir of the repo that you would like to convert which can be added to clipboard by clicking the filename and then the copy icon ⧉ next to file names title and input that to filename box. | |
- Paste the model id of your new repo in the your_model_id box. | |
- Click "Submit". | |
- That's it! You'll get feedback if it works or not, and if it worked, you'll get the URL of the opened PR 🔥. | |
⚠️ If you encounter weird error messages, please have a look into the Logs and feel free to open a PR to correct the error messages. | |
""" | |
demo = gr.Interface( | |
title="Convert any weights only .pt, .pth, .bin, .ckpt to .safetensors and open a PR", | |
description=DESCRIPTION, | |
flagging_mode="never", | |
article="placeholder", | |
inputs=[ | |
gr.Text(max_lines=1, label="your_hf_token"), | |
gr.Text(max_lines=1, label="model_id"), | |
gr.Text(max_lines=1, label="filename"), | |
gr.Text(max_lines=1, label="your_model_id"), | |
], | |
outputs=[gr.Markdown(label="output")], | |
fn=convert, | |
) | |
demo.launch(show_api=True) | |