Spaces:
Sleeping
Sleeping
# | |
# gradio demo | |
# | |
import gradio as gr | |
from transformers import pipeline | |
model = pipeline("text-generation", model="openai-community/gpt2") | |
title = "openai-community/gpt2 prompt completion" | |
description = "Basic demo from the NLP course" | |
def predict(prompt): | |
completion = model(prompt)[0]["generated_text"] | |
return completion | |
demo = gr.Interface(fn=predict, inputs="text", outputs="text") | |
demo.launch() |