File size: 646 Bytes
290cd13
a01b0e4
 
290cd13
 
 
 
 
a01b0e4
290cd13
 
 
 
 
 
 
a01b0e4
 
 
290cd13
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# -*- coding: utf-8 -*-


import gradio as gr
import langChain_test
 
def image_to_text(image_path,question):
    return langChain_test.imageAnalyse(image_path,question)
    
 
with gr.Blocks() as demo:
    image_path = gr.Image(type="filepath",label="请选择一张图片")
    question = gr.Textbox(label="输入您的问题",lines=2)
    output = gr.Textbox(label="输出答案",lines=2,placeholder="提交后将自动输出答案")
    greet_btn = gr.Button("提交",variant="primary")
    greet_btn.click(fn=image_to_text, inputs=[image_path,question], outputs=output, api_name="image_to_text")



demo.launch() 
 
#demo.launch(share=True)