from transformers import pipeline import gradio as gr model = pipeline("text-generation", model="lastversion") def predict(prompt): completion = model(prompt, max_length=50)[0]["generated_text"] return completion gr.Interface(fn=predict, inputs="text", outputs="text").launch(share=True)