Update app.py
Browse files
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(
|
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:
|