Dongxu Li commited on
Commit ·
6b1676b
1
Parent(s): e7d2256
update ui.
Browse files124 unmodified lines12512612712812913013113213313413513613711 unmodified lines14915015115215315415560 unmodified lines216217218219220221222223124 unmodified linesreturn output[0]# def clear_fn(image_input, chatbot, chat_input, caption_output, state):# # if image_input is None:# return (None, "", "", [])# else:# return chatbot, chat_input, caption_output, statetitle = """<h1 align="center">BLIP-2</h1>"""description = """Gradio demo for BLIP-2, image-to-text generation from Salesforce Research. To use it, simply upload your image, or click one of the examples to load them.<br> <strong>Disclaimer</strong>: This is a research prototype and is not intended for production use. No data including but not restricted to text and images is collected."""11 unmodified lines["forbidden_city.webp", "In what dynasties was this place built?"],]with gr.Blocks() as iface:state = gr.State([])gr.Markdown(title)60 unmodified linesgr.Markdown("""Trying prompting your input for chat; e.g. example prompt for QA, \"Question: {} Answer:\"""")with gr.Row():with gr.Column(scale=1.5):chatbot = gr.Chatbot(label="Chat Output (from FlanT5)")# with gr.Row():with gr.Column(scale=1):124 unmodified lines12512612712812913011 unmodified lines14214314414514614714814915060 unmodified lines211212213214215216217218219220221222124 unmodified linesreturn output[0]title = """<h1 align="center">BLIP-2</h1>"""description = """Gradio demo for BLIP-2, image-to-text generation from Salesforce Research. To use it, simply upload your image, or click one of the examples to load them.<br> <strong>Disclaimer</strong>: This is a research prototype and is not intended for production use. No data including but not restricted to text and images is collected."""11 unmodified lines["forbidden_city.webp", "In what dynasties was this place built?"],]with gr.Blocks(css=""".message.svelte-w6rprc.svelte-w6rprc.svelte-w6rprc {font-size: 20px; margin-top: 20px}""") as iface:state = gr.State([])gr.Markdown(title)60 unmodified linesgr.Markdown("""Trying prompting your input for chat; e.g. example prompt for QA, \"Question: {} Answer:\"""")with gr.Row():with gr.Column(scale=1.5,):chatbot = gr.Chatbot(label="Chat Output (from FlanT5)",)# with gr.Row():with gr.Column(scale=1):
app.py+9-10