Spaces:
Runtime error
Runtime error
tlodato
commited on
Commit
·
1df0b7b
1
Parent(s):
1e111d1
update
Browse files
app.py
CHANGED
@@ -11,14 +11,6 @@ def vqa(image_path:str, prompt:str):
|
|
11 |
result = client.predict(image_path,prompt,fn_index=3)
|
12 |
return result
|
13 |
|
14 |
-
def variants(image_path:str,prompt:str):
|
15 |
-
with tempfile.NamedTemporaryFile(mode="wb") as img:
|
16 |
-
img = Image.open(image_path,mode="r").rotate(90).save("temp.jpg")
|
17 |
-
return vqa(img,prompt)
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
css = """
|
23 |
#mkd {
|
24 |
height: 500px;
|
@@ -33,7 +25,7 @@ with gr.Blocks(css=css) as demo:
|
|
33 |
vqa_output = gr.Textbox(label="Output")
|
34 |
vqa_btn = gr.Button("Answer Visual Question")
|
35 |
vqa_btn.click(
|
36 |
-
fn=
|
37 |
inputs = [image_input,text_input],
|
38 |
outputs = vqa_output
|
39 |
)
|
|
|
11 |
result = client.predict(image_path,prompt,fn_index=3)
|
12 |
return result
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
css = """
|
15 |
#mkd {
|
16 |
height: 500px;
|
|
|
25 |
vqa_output = gr.Textbox(label="Output")
|
26 |
vqa_btn = gr.Button("Answer Visual Question")
|
27 |
vqa_btn.click(
|
28 |
+
fn=vqa,
|
29 |
inputs = [image_input,text_input],
|
30 |
outputs = vqa_output
|
31 |
)
|