Spaces:
Runtime error
Runtime error
tlodato
commited on
Commit
·
b34ea79
1
Parent(s):
11990fc
update
Browse files
app.py
CHANGED
@@ -7,6 +7,7 @@ client = Client("https://adept-fuyu-8b-demo.hf.space/--replicas/9kcqv/")
|
|
7 |
|
8 |
filepath = "https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/bus.png"
|
9 |
question = "what color is the bus?"
|
|
|
10 |
def vqa(image, prompt):
|
11 |
result = client.predict(image,text,fn_index=3)
|
12 |
return result
|
@@ -26,5 +27,10 @@ with gr.Blocks(css=css) as demo:
|
|
26 |
text_input = gr.Textbox(label="Ask a Question")
|
27 |
vqa_output = gr.Textbox(label="Output")
|
28 |
vqa_btn = gr.Button("Answer Visual Question")
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
demo.launch()
|
|
|
7 |
|
8 |
filepath = "https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/bus.png"
|
9 |
question = "what color is the bus?"
|
10 |
+
|
11 |
def vqa(image, prompt):
|
12 |
result = client.predict(image,text,fn_index=3)
|
13 |
return result
|
|
|
27 |
text_input = gr.Textbox(label="Ask a Question")
|
28 |
vqa_output = gr.Textbox(label="Output")
|
29 |
vqa_btn = gr.Button("Answer Visual Question")
|
30 |
+
vqa_btn.click(
|
31 |
+
fn=vqa,
|
32 |
+
inputs = [image_input,text_input],
|
33 |
+
outputs = vqa_output
|
34 |
+
)
|
35 |
|
36 |
demo.launch()
|