Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| from setfit import SetFitModel | |
| # Download from Hub and run inference | |
| model = SetFitModel.from_pretrained("eclaircies/ecolo-pas-ecolo-v0.2") | |
| # Labels | |
| labels = ['pas écolo', 'ça dépend', 'écolo'] | |
| def predict(concept): | |
| preds = int(model([concept]).detach().numpy()) | |
| return labels[preds] | |
| iface = gr.Interface(fn=predict, inputs="text", outputs="text") | |
| iface.launch() |