Spaces:
Runtime error
Runtime error
Update app.py
Browse files12345678910111213141516171819202122import gradio as grdef flip_text(x):return x[::-1]demo = gr.Blocks()with demo:gr.Markdown("""# Flip Text!Start typing below to see the output.""")input = gr.Textbox(placeholder="Flip this text")output = gr.Textbox()input.change(fn=flip_text, inputs=input, outputs=output)demo.launch()1234567891011121314151617import gradio as grapi = gr.Interface.load("huggingface/EleutherAI/gpt-j-6B")def complete_with_gpt(text):# Use the last 50 characters of the text as contextreturn text[:-50] + api(text[-50:])with gr.Blocks() as demo:textbox = gr.Textbox(placeholder="Type here and press enter...", lines=4)btn = gr.Button("Generate")btn.click(complete_with_gpt, textbox, textbox)demo.launch()
app.py+8-13