from transformers import pipeline import gradio as gr pipeline = pipeline("text-generation", model="openai-community/gpt2") gr.Interface.from_pipeline(pipeline).launch()