import gradio as gr from transformers import pipeline pipe = pipeline("text-classification", model="hackathon-pln-es/electricidad-base-generator-fake-news") def predict(text): return pipe(text)[0]["text-classification_text"] title = "Detección de FakeNews en Español" iface = gr.Interface( fn=predict, inputs=[gr.inputs.Textbox(label="text", lines=3)], outputs='text', title=title, examples=[["España desaparece"]] ) iface.launch(debug=True)