JunnanLi commited on
Commit
369f023
1 Parent(s): ea784ed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -49,7 +49,7 @@ def inference(raw_image, model_n, question, strategy):
49
  if model_n == 'Image Captioning':
50
  image = transform(raw_image).unsqueeze(0).to(device)
51
  with torch.no_grad():
52
- if strategy == "beam search":
53
  caption = model.generate(image, sample=False, num_beams=3, max_length=20, min_length=5)
54
  else:
55
  caption = model.generate(image, sample=True, top_p=0.9, max_length=20, min_length=5)
 
49
  if model_n == 'Image Captioning':
50
  image = transform(raw_image).unsqueeze(0).to(device)
51
  with torch.no_grad():
52
+ if strategy == "Beam search":
53
  caption = model.generate(image, sample=False, num_beams=3, max_length=20, min_length=5)
54
  else:
55
  caption = model.generate(image, sample=True, top_p=0.9, max_length=20, min_length=5)