File size: 317 Bytes
71a48d6
 
a27137b
71a48d6
a27137b
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
import gradio as gr

api = gr.Interface.load("huggingface/EleutherAI/gpt-neo-1.3B")

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

with gr.Blocks as demo():
    textbox = gr.Textbox(placeholder="Input text", lines=5)
    btn = gr.Button("Submit")
    btn.click(ai_text, textbox, textbox)

demo.launch()