dafajudin commited on
Commit
952b001
1 Parent(s): 4ccccb1

Add application file

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ Visual_QA = pipeline(model="jihadzakki/blip1-medvqa")
3
+
4
+ #Build Visual QA App
5
+ import gradio as gr
6
+ VisualQAApp = gr.Interface(fn=Visual_QA,
7
+ inputs=[
8
+ gr.Image(label="Upload image", type="pil"),
9
+ gr.Textbox(label="Question"),
10
+ ],
11
+ outputs=[gr.Textbox(label="Answer")],
12
+ title="Visual Question Answering using BLIP Model",
13
+ description="VQA",
14
+ allow_flagging="never")
15
+ VisualQAApp.launch(share=True)