Spaces:
Runtime error
Runtime error
added some tweaks to the UI
#3
by ysharma HF Staff - opened
143 unmodified lines1441451461471481491501511521531541551565 unmodified lines16216316416516616716816917017111 unmodified lines183184185186187188189190191143 unmodified lines'CannyText2Image':'cuda:0','InstructPix2Pix':'cuda:0'})with gr.Blocks(css="#chatbot .overflow-y-auto{height:500px}") as demo:with gr.Row():gr.Markdown("<h3><center>Visual ChatGPT</center></h3>")with gr.Row():openai_api_key_textbox = gr.Textbox(placeholder="Paste your OpenAI API key here to start Visual ChatGPT(sk-...)",show_label=False,lines=1,type="password",5 unmodified lineswith gr.Row(visible=False) as input_raws:with gr.Column(scale=0.7):txt = gr.Textbox(show_label=False, placeholder="Enter text and press enter, or upload an image").style(container=False)with gr.Column(scale=0.15, min_width=0):clear = gr.Button("Clear️")with gr.Column(scale=0.15, min_width=0):btn = gr.UploadButton("Upload", file_types=["image"])gr.Examples(examples=["Generate a figure of a cat running in the garden",11 unmodified linesopenai_api_key_textbox.submit(bot.init_agent, [openai_api_key_textbox], [input_raws])txt.submit(bot.run_text, [txt, state], [chatbot, state])txt.submit(lambda: "", None, txt)btn.upload(bot.run_image, [btn, state, txt], [chatbot, state, txt])clear.click(bot.memory.clear)clear.click(lambda: [], None, chatbot)clear.click(lambda: [], None, state)demo.launch(server_name="0.0.0.0", server_port=7860)143 unmodified lines1441451461471481491501511521531541551565 unmodified lines16216316416516616716816917017117217311 unmodified lines185186187188189190191192193194195143 unmodified lines'CannyText2Image':'cuda:0','InstructPix2Pix':'cuda:0'})with gr.Blocks(css="#chatbot {overflow:auto; height:500px;}") as demo:with gr.Row():gr.Markdown("<h3><center>Visual ChatGPT</center></h3>")with gr.Row():openai_api_key_textbox = gr.Textbox(placeholder="Paste your OpenAI API key here to start Visual ChatGPT(sk-...) and press Enter ↵️",show_label=False,lines=1,type="password",5 unmodified lineswith gr.Row(visible=False) as input_raws:with gr.Column(scale=0.7):txt = gr.Textbox(show_label=False, placeholder="Enter text and press enter, or upload an image").style(container=False)with gr.Column(scale=0.10, min_width=0):run = gr.Button("🏃♂️Run")with gr.Column(scale=0.10, min_width=0):clear = gr.Button("🔄Clear️")with gr.Column(scale=0.10, min_width=0):btn = gr.UploadButton("🖼️Upload", file_types=["image"])gr.Examples(examples=["Generate a figure of a cat running in the garden",11 unmodified linesopenai_api_key_textbox.submit(bot.init_agent, [openai_api_key_textbox], [input_raws])txt.submit(bot.run_text, [txt, state], [chatbot, state])txt.submit(lambda: "", None, txt)run.click(bot.run_text, [txt, state], [chatbot, state])run.click(lambda: "", None, txt)btn.upload(bot.run_image, [btn, state, txt], [chatbot, state, txt])clear.click(bot.memory.clear)clear.click(lambda: [], None, chatbot)clear.click(lambda: [], None, state)demo.queue(concurrency_count=10).launch(server_name="0.0.0.0", server_port=7860)
app.py+11-7