Commit
·
cadcb55
1
Parent(s):
24a0d89
Update app.py
Browse files
app.py
CHANGED
@@ -25,7 +25,8 @@ else:
|
|
25 |
def blip2_interface(image, prompted_caption_text, vqa_question, chat_context):
|
26 |
# Prepare image input
|
27 |
image_input = Image.fromarray(image).convert('RGB')
|
28 |
-
inputs = processor(image_input, return_tensors="pt").to(device
|
|
|
29 |
|
30 |
# Image Captioning
|
31 |
generated_ids = model.generate(**inputs, max_new_tokens=20)
|
|
|
25 |
def blip2_interface(image, prompted_caption_text, vqa_question, chat_context):
|
26 |
# Prepare image input
|
27 |
image_input = Image.fromarray(image).convert('RGB')
|
28 |
+
inputs = processor(image_input, return_tensors="pt").to(device) # Remove torch.float16 dtype conversion
|
29 |
+
|
30 |
|
31 |
# Image Captioning
|
32 |
generated_ids = model.generate(**inputs, max_new_tokens=20)
|