nielsr HF staff commited on
Commit
5dd3d52
1 Parent(s): 740fb26

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -44,7 +44,7 @@ def generate_caption_blip2(processor, model, image, replace_token=False):
44
 
45
  inputs = processor(images=image, text=prompt, return_tensors="pt").to(device=model.device, dtype=torch.float16)
46
 
47
- generated_ids = model.generate(pixel_values=inputs.pixel_values,
48
  num_beams=5, max_length=50, min_length=1, top_p=0.9,
49
  repetition_penalty=1.5, length_penalty=1.0, temperature=1)
50
  if replace_token:
 
44
 
45
  inputs = processor(images=image, text=prompt, return_tensors="pt").to(device=model.device, dtype=torch.float16)
46
 
47
+ generated_ids = model.generate(**inputs,
48
  num_beams=5, max_length=50, min_length=1, top_p=0.9,
49
  repetition_penalty=1.5, length_penalty=1.0, temperature=1)
50
  if replace_token: