Spaces:
Build error
Build error
fix: trim white space for comma separated captions
Browse files- 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 |
)
|