textgeneration / app.py
tomcheng's picture
Update app.py
1e34bfb
raw
history blame
432 Bytes
import gradio as gr
api=gr.Interface.load("huggingface/EleutherAI/gpt-j-6B")
def complete_with_gpt(text):
return text[:-50]+api(text[-50:])
with gr.Block()as demo:
with gr.Row()
textbox=gr.Textbox(placeholder="Type here and press enter...",
lines=8)
with gr.Columu():
btn=gr.Button("Generate")
btn.click(complete_with_gpt,textbox,textbox)
demo.launch()