Update app.py
Browse files
app.py
CHANGED
@@ -101,7 +101,7 @@ def textMode(text, count):
|
|
101 |
def imageMode(image, question):
|
102 |
image_embedding = encode_image(image)
|
103 |
print('-------Image embedding from clip obtained-----------')
|
104 |
-
imgToTextEmb = img_proj_head(image_embedding)
|
105 |
print('-------text embedding from projection obtained-----------')
|
106 |
question = "Question: " + question + "Answer: "
|
107 |
Qtokens = torch.tensor(tokenizer_text.encode(question, add_special_tokens=True)).unsqueeze(0)
|
|
|
101 |
def imageMode(image, question):
|
102 |
image_embedding = encode_image(image)
|
103 |
print('-------Image embedding from clip obtained-----------')
|
104 |
+
imgToTextEmb = img_proj_head(image_embedding).unsqueeze(0)
|
105 |
print('-------text embedding from projection obtained-----------')
|
106 |
question = "Question: " + question + "Answer: "
|
107 |
Qtokens = torch.tensor(tokenizer_text.encode(question, add_special_tokens=True)).unsqueeze(0)
|