File size: 412 Bytes
ed15f20
3e47940
d37ee62
36aadcc
d37ee62
 
1590c11
d37ee62
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import gradio as gr

api = gr.interface.load("huggigngface/EleutherAI/gpt-neo-2.7B")

def complete_with_gpt(text):
    return text [:-50] + api(text[-50:])

with gr.Blocks() as demo:
    with gr.Row():
        textbox = gr.Textbox(placeholder="Type here and press enter...", lines=8)
        with gr.Column():
            btn gr.Butto("Generate")

    btn.click(complete_with_gpt, textbox, textbox)
demo.launch()