Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,7 +13,7 @@ def create_caption_transformer(img):
|
|
| 13 |
"""
|
| 14 |
|
| 15 |
sample = feature_extractor(img, return_tensors="pt").pixel_values.to('cpu')
|
| 16 |
-
caption_ids = model.generate(sample)[0]
|
| 17 |
caption_text = tokenizer.decode(caption_ids, skip_special_tokens=True)
|
| 18 |
caption_text = caption_text.split('.')[0]
|
| 19 |
return caption_text
|
|
|
|
| 13 |
"""
|
| 14 |
|
| 15 |
sample = feature_extractor(img, return_tensors="pt").pixel_values.to('cpu')
|
| 16 |
+
caption_ids = model.generate(sample)[0]
|
| 17 |
caption_text = tokenizer.decode(caption_ids, skip_special_tokens=True)
|
| 18 |
caption_text = caption_text.split('.')[0]
|
| 19 |
return caption_text
|