Spaces:
Build error
Build error
| import gradio as gr | |
| import tempfile | |
| import joblib | |
| from skops import io as sio | |
| def convert(file): | |
| print(file) | |
| obj = joblib.load(file) | |
| _, fname = tempfile.mkstemp(prefix=file + ".skops") | |
| sio.dump(obj, fname) | |
| return fname | |
| with gr.Blocks() as iface: | |
| file_output = gr.File() | |
| upload_button = gr.UploadButton("Click to Upload a File", file_types=none, file_count="single") | |
| upload_button.upload(convert, upload_button, file_output) | |
| iface.launch() |