gpt2_experiment / app.py
biranchi125's picture
Update app.py
c7cc4b1
raw
history blame
365 Bytes
import gradio as gr
from transformers import pipeline
pipeline = pipeline(task="text-generation", model="gpt2")
def greet(name):
return "Hello " + name + "!!"
def gen_text(text):
if len(text) > 0:
return pipeline(text)[0]
else:
return "Enter text"
iface = gr.Interface(fn=gen_text, inputs="text", outputs="text")
iface.launch()