text_generator / app.py
Wootang01's picture
Update app.py
a27137b
raw
history blame
317 Bytes
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()