import gradio as gr from transformers import pipeline # def greet(name): # return "Hello " + name + "!!" # iface = gr.Interface(fn=greet, inputs="text", outputs="text") # iface.launch() model = pipeline("text-generation") def predict(prompt): completion = model(prompt)[0]["generated_text"] return completion predict("My favorite programming language is") gr.Interface(fn=predict, inputs="text", outputs="text").launch()