from transformers import pipeline import gradio as gr # First define a prediction function that takes in a text prompt and returns the text completion model = pipeline('text-generation') def predict(prompt): completion = model(prompt)[0]['generated_text'] return completion # Now create the interface gr.Interface(fn=predict, inputs="text", outputs="text", css=".footer{display:none !important}").launch()