nielsr HF staff commited on
Commit
4c7ba7b
1 Parent(s): 0865f24

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -46,7 +46,7 @@ def generate_answer_git(processor, model, image, question):
46
 
47
  def generate_answer_blip(processor, model, image, question):
48
  # prepare image + question
49
- inputs = processor(images=image, text=text, return_tensors="pt")
50
 
51
  generated_ids = model.generate(**inputs, max_length=50)
52
  generated_answer = processor.batch_decode(generated_ids, skip_special_tokens=True)
@@ -56,7 +56,7 @@ def generate_answer_blip(processor, model, image, question):
56
 
57
  def generate_answer_vilt(processor, model, image, question):
58
  # prepare image + question
59
- encoding = processor(image, text, return_tensors="pt")
60
 
61
  with torch.no_grad():
62
  outputs = model(**encoding)
46
 
47
  def generate_answer_blip(processor, model, image, question):
48
  # prepare image + question
49
+ inputs = processor(images=image, text=question, return_tensors="pt")
50
 
51
  generated_ids = model.generate(**inputs, max_length=50)
52
  generated_answer = processor.batch_decode(generated_ids, skip_special_tokens=True)
56
 
57
  def generate_answer_vilt(processor, model, image, question):
58
  # prepare image + question
59
+ encoding = processor(images=image, text=question, return_tensors="pt")
60
 
61
  with torch.no_grad():
62
  outputs = model(**encoding)