ecolo-pas-ecolo / app.py
TheoLvs's picture
Update app.py
cc58e32
raw
history blame contribute delete
399 Bytes
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()