Spaces:
Runtime error
Runtime error
Commit
·
62eb258
1
Parent(s):
e55a64f
Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ model = VisionEncoderDecoderModel.from_pretrained(model_checkpoint).to(device)
|
|
16 |
|
17 |
def predict(image):
|
18 |
"""Predict the generic image caption from the image """
|
19 |
-
image = image.convert('RGB')
|
20 |
image = feature_extractor(image, return_tensors="pt").pixel_values.to(device)
|
21 |
clean_text = lambda x: x.replace('<|endoftext|>', '').split('\n')[0]
|
22 |
caption_ids = model.generate(image, max_length=125)[0]
|
|
|
16 |
|
17 |
def predict(image):
|
18 |
"""Predict the generic image caption from the image """
|
19 |
+
# image = image.convert('RGB')
|
20 |
image = feature_extractor(image, return_tensors="pt").pixel_values.to(device)
|
21 |
clean_text = lambda x: x.replace('<|endoftext|>', '').split('\n')[0]
|
22 |
caption_ids = model.generate(image, max_length=125)[0]
|