gpt-2 / app.py
abidlabs's picture
abidlabs HF staff
Update app.py
5fe34af
raw
history blame contribute delete
417 Bytes
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()