File size: 273 Bytes
e5cc669
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
import gradio as gr
from transformers import pipeline

generator = pipeline("text-generation", model = "distilgpt2")


prompt = "This tutorial is about"
generator(prompt, max_length = 30)

iface = gr.Interface(fn=generate_text, inputs="text", outputs="text")
iface.launch()