xzuyn commited on
Commit
2de3863
·
verified ·
1 Parent(s): 487138c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -51,11 +51,14 @@ def process_image(image):
51
 
52
  # Decode and post-process the generated text
53
  generated_text = processor.batch_decode(
54
- generated_ids, skip_special_tokens=False
 
55
  )[0]
56
  caption = processor.post_process_generation(
57
- generated_text, task="<CAPTION>", image_size=(image.width, image.height)
58
- )[0]
 
 
59
  return caption
60
 
61
  except Exception as e:
 
51
 
52
  # Decode and post-process the generated text
53
  generated_text = processor.batch_decode(
54
+ generated_ids,
55
+ skip_special_tokens=False
56
  )[0]
57
  caption = processor.post_process_generation(
58
+ generated_text,
59
+ task="<CAPTION>",
60
+ image_size=(image.width, image.height)
61
+ )
62
  return caption
63
 
64
  except Exception as e: