import gradio as gr from transformers import pipeline def do_action(text): pipe = pipeline("text-classification", model="papluca/xlm-roberta-base-language-detection") result = pipe(text, top_k=10) return result iface = gr.Interface(fn=do_action, inputs="text", outputs="text") iface.launch()