sourabhbargi11 commited on
Commit
7644923
·
verified ·
1 Parent(s): 5b1d9c2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -39,10 +39,9 @@ def generate_caption(image_processor, model, tokenizer,device, image):
39
  pixel_values=inputs ,
40
  max_length=1000,# Adjust the maximum length of the generated caption as needed
41
  num_beams=4, # Adjust the number of beams for beam search decoding
42
- early_stopping=True # Enable early stopping to stop generation when all beams finished
43
- ,batch_size=1
44
  )
45
-
46
  # Decode the generated caption
47
  caption = tokenizer.decode(output[0], skip_special_tokens=True)
48
  return caption
 
39
  pixel_values=inputs ,
40
  max_length=1000,# Adjust the maximum length of the generated caption as needed
41
  num_beams=4, # Adjust the number of beams for beam search decoding
42
+ early_stopping=True , # Enable early stopping to stop generation when all beams finished
43
+ batch_size=1
44
  )
 
45
  # Decode the generated caption
46
  caption = tokenizer.decode(output[0], skip_special_tokens=True)
47
  return caption