ManishThota commited on
Commit
143ba51
·
verified ·
1 Parent(s): 6a70eef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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="This model answers questions based on the content of an image. Powered by BLIP.",
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