Update README.md
Browse files
README.md
CHANGED
@@ -76,11 +76,11 @@ query_full = query_instruction + query
|
|
76 |
|
77 |
# Embed image documents
|
78 |
with torch.no_grad():
|
79 |
-
p_reps = model(text=['', '', ''], image=[image_1, image_2, image_3], tokenizer=tokenizer)
|
80 |
|
81 |
# Embed text queries
|
82 |
with torch.no_grad():
|
83 |
-
q_reps = model(text=[query_full], image=[None], tokenizer=tokenizer) # [B, s, d]
|
84 |
|
85 |
# Calculate similarities
|
86 |
scores = torch.matmul(q_reps, p_reps.T)
|
|
|
76 |
|
77 |
# Embed image documents
|
78 |
with torch.no_grad():
|
79 |
+
p_reps = model(text=['', '', ''], image=[image_1, image_2, image_3], tokenizer=tokenizer).reps
|
80 |
|
81 |
# Embed text queries
|
82 |
with torch.no_grad():
|
83 |
+
q_reps = model(text=[query_full], image=[None], tokenizer=tokenizer).reps # [B, s, d]
|
84 |
|
85 |
# Calculate similarities
|
86 |
scores = torch.matmul(q_reps, p_reps.T)
|