Spaces:
Paused
Paused
root commited on
Commit ·
d44bf9b
1
Parent(s): b9e7cf7
add example
Browse filesFiles changed (2)
- app.py+9-7
- forbidden_city.webpAdded
119 unmodified lines1201211221231241251261 unmodified line12812913013113213322 unmodified lines1561571581591601611621631641651661671681691701711726 unmodified lines17918018118218318418513 unmodified lines199200201202203204205119 unmodified linestitle = """<h1 align="center">BLIP-2</h1>"""description = """Gradio demo for BLIP-2, a multimodal chatbot from Salesforce Research. To use it, simply upload your image, or click one of the examples to load them. Please visit our <a href='https://github.com/salesforce/LAVIS/tree/main/projects/blip2' target='_blank'>project webpage</a>.</p><p> <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. </p>"""article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2201.12086' target='_blank'>BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language Models</a>"1 unmodified lineexamples = [["house.png", "How could someone get out of the house?"],# [# "sunset.png",# "Write a romantic message that goes along this photo.",22 unmodified linesminimum=0.5,maximum=1.0,value=0.8,interactive=True,label="Temperature (set to 0 for greedy decoding with nucleus sampling)",)len_penalty = gr.Slider(minimum=-2.0,maximum=2.0,value=1.0,step=0.5,interactive=True,label="Length Penalty (larger value encourages longer sequence with beam search)",)rep_penalty = gr.Slider(6 unmodified lines)with gr.Row():caption_output = gr.Textbox(lines=2, label="Caption Output")caption_button = gr.Button(value="Caption it!", interactive=True, variant="primary")13 unmodified lineschat_input = gr.Textbox(lines=2, label="Chat Input")with gr.Row():chatbot = gr.Chatbot()image_input.change(lambda: (None, "", "", []), [], [chatbot, chat_input, caption_output, state])with gr.Row():119 unmodified lines1201211221231241251261 unmodified line12812913013113213313422 unmodified lines1571581591601611621631641651661671681691701711721731746 unmodified lines18118218318418518618713 unmodified lines201202203204205206207119 unmodified linestitle = """<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. Please visit our <a href='https://github.com/salesforce/LAVIS/tree/main/projects/blip2' target='_blank'>project webpage</a>.</p><p> <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. </p>"""article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2201.12086' target='_blank'>BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language Models</a>"1 unmodified lineexamples = [["house.png", "How could someone get out of the house?"],["forbidden_city.webp", "In what dynasties was this place build?"],# [# "sunset.png",# "Write a romantic message that goes along this photo.",22 unmodified linesminimum=0.5,maximum=1.0,value=0.8,step=0.1,interactive=True,label="Temperature (used with nucleus sampling)",)len_penalty = gr.Slider(minimum=-1.0,maximum=2.0,value=1.0,step=0.2,interactive=True,label="Length Penalty (set to larger for longer sequence, used with beam search)",)rep_penalty = gr.Slider(6 unmodified lines)with gr.Row():caption_output = gr.Textbox(lines=2, label="Caption Output (from OPT)")caption_button = gr.Button(value="Caption it!", interactive=True, variant="primary")13 unmodified lineschat_input = gr.Textbox(lines=2, label="Chat Input")with gr.Row():chatbot = gr.Chatbot(label="Chat Output (from FlanT5)")image_input.change(lambda: (None, "", "", []), [], [chatbot, chat_input, caption_output, state])with gr.Row():
app.py+9-7
forbidden_city.webpAdded
