jaketae commited on
Commit
cb0c585
1 Parent(s): df702af

fix: trim white space for comma separated captions

Browse files
Files changed (1) hide show
  1. image2text.py +1 -1
image2text.py CHANGED
@@ -41,7 +41,7 @@ def app(model_name):
41
  )
42
  image = Image.open(image_data)
43
  st.image(image)
44
- captions = captions.split(",")
45
  inputs = processor(
46
  text=captions, images=image, return_tensors="jax", padding=True
47
  )
 
41
  )
42
  image = Image.open(image_data)
43
  st.image(image)
44
+ captions = [caption.strip() for caption in captions.split(",")]
45
  inputs = processor(
46
  text=captions, images=image, return_tensors="jax", padding=True
47
  )