from huggingface_hub import from_pretrained_fastai import gradio as gr from fastai.vision.all import * repo_id = "MarioGL/emotion" learn = load_learner(repo_id) def classify_text(text): pred, pred_idx, probs = learn.predict(text) return pred, probs[pred_idx].item() iface = gr.Interface(fn=classify_text, inputs=gr.Textbox(label="Introduce un texto"), outputs=[gr.Label(), gr.Textbox()], live=True) iface.launch()