File size: 408 Bytes
250b372
 
e5bf024
14d532b
 
21b0616
14d532b
 
21b0616
 
 
 
f6070e7
14d532b
e91bfe2
14d532b
4e6a132
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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.Blocks()as demo: 
    with gr.Row():
     textbox=gr.Textbox(placeholder="Type here and press enter...",
lines=8)
     with gr.Column(): 
      btn=gr.Button("Generate")
        
    btn.click(complete_with_gpt,textbox,textbox) 
        
demo.launch()