Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ def predict_answer(image, question):
|
|
17 |
# Prepare inputs
|
18 |
encoding = processor(image, question, return_tensors="pt")
|
19 |
|
20 |
-
out = model.generate(**encoding)
|
21 |
generated_text = processor.decode(out[0], skip_special_tokens=True)
|
22 |
|
23 |
return generated_text
|
@@ -33,7 +33,7 @@ iface = gr.Interface(
|
|
33 |
inputs=[gr.Image(type="pil", label="Upload or Drag an Image"), gr.Textbox(label="Question", placeholder="e.g. What is this?", scale=4)],
|
34 |
outputs=gr.TextArea(label="Answer"),
|
35 |
title="Visual Question Answering",
|
36 |
-
description="
|
37 |
)
|
38 |
|
39 |
# Launch the app
|
|
|
17 |
# Prepare inputs
|
18 |
encoding = processor(image, question, return_tensors="pt")
|
19 |
|
20 |
+
out = model.generate(**encoding, max_length=512)
|
21 |
generated_text = processor.decode(out[0], skip_special_tokens=True)
|
22 |
|
23 |
return generated_text
|
|
|
33 |
inputs=[gr.Image(type="pil", label="Upload or Drag an Image"), gr.Textbox(label="Question", placeholder="e.g. What is this?", scale=4)],
|
34 |
outputs=gr.TextArea(label="Answer"),
|
35 |
title="Visual Question Answering",
|
36 |
+
description="Tiny 1B parameter Vision Language Model.",
|
37 |
)
|
38 |
|
39 |
# Launch the app
|