003 / app.py
CaiRou-Huang's picture
Update app.py
cddf551
raw
history blame
279 Bytes
import gradio as gr
from transformers import pipeline
pipe = pipeline("text-generation", model="gpt2")
def predict(prompt):
completion = model(prompt)[0]["generated_text"]
return completion
iface = gr.Interface(fn=predict, inputs="text", outputs="text")
iface.launch()