fix: changed sample to True to generate caption using blip model

This commit is contained in:
Luke Pearson 2023-04-18 12:37:59 +01:00 committed by Bryce
parent 95d3d08d27
commit 94728d978e

View File

@ -57,6 +57,6 @@ def generate_caption(image, min_length=30):
with torch.no_grad():
caption = blip_model().generate(
gpu_image, sample=False, num_beams=3, max_length=80, min_length=min_length
gpu_image, sample=True, num_beams=3, max_length=80, min_length=min_length
)
return caption[0]