Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ import torch
|
|
3 |
import bitsandbytes
|
4 |
import accelerate
|
5 |
import scipy
|
|
|
6 |
|
7 |
from transformers import Blip2Processor, Blip2ForConditionalGeneration
|
8 |
|
@@ -20,6 +21,8 @@ def answer_question(image, question, model, processor):
|
|
20 |
|
21 |
|
22 |
image = Image.open(image).convert('RGB')
|
|
|
|
|
23 |
|
24 |
inputs = processor(image, question, return_tensors="pt").to("cuda", torch.float16)
|
25 |
|
|
|
3 |
import bitsandbytes
|
4 |
import accelerate
|
5 |
import scipy
|
6 |
+
from PIL import Image
|
7 |
|
8 |
from transformers import Blip2Processor, Blip2ForConditionalGeneration
|
9 |
|
|
|
21 |
|
22 |
|
23 |
image = Image.open(image).convert('RGB')
|
24 |
+
|
25 |
+
|
26 |
|
27 |
inputs = processor(image, question, return_tensors="pt").to("cuda", torch.float16)
|
28 |
|