File size: 442 Bytes
2b2a4fb
 
 
2efe7bf
1c08b0d
2b2a4fb
a4a08e5
 
2d120d2
2b2a4fb
 
ed3c125
2b2a4fb
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import gradio as gr
from transformers import pipeline

pipe = pipeline("visual-question-answering", model = "openbmb/MiniCPM-Llama3-V-2_5", trust_remote_code=True)
#model="Salesforce/blip2-opt-2.7b")

def launch(input1, input2):
    out = pipe(input1, input2)
    return out#['generated_text']

iface = gr.Interface(launch,
                     inputs=[gr.Image(type='pil'), gr.Textbox()],
                     outputs="text")

iface.launch()