Spaces:
Runtime error
Runtime error
Linoy Tsaban
commited on
Commit
·
0e70f76
1
Parent(s):
c9dd9ff
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,7 +26,7 @@ blip_model = BlipForConditionalGeneration.from_pretrained("Salesforce/blip-image
|
|
| 26 |
## IMAGE CPATIONING ##
|
| 27 |
def caption_image(input_image):
|
| 28 |
|
| 29 |
-
inputs = blip_processor(images=input_image, return_tensors="pt")
|
| 30 |
pixel_values = inputs.pixel_values
|
| 31 |
|
| 32 |
generated_ids = blip_model.generate(pixel_values=pixel_values, max_length=50)
|
|
|
|
| 26 |
## IMAGE CPATIONING ##
|
| 27 |
def caption_image(input_image):
|
| 28 |
|
| 29 |
+
inputs = blip_processor(images=input_image, return_tensors="pt").to(device)
|
| 30 |
pixel_values = inputs.pixel_values
|
| 31 |
|
| 32 |
generated_ids = blip_model.generate(pixel_values=pixel_values, max_length=50)
|