Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -35,6 +35,8 @@ def preprocess(temp):
|
|
35 |
def match_img(txt_vec):
|
36 |
sim_matrix = []
|
37 |
for vec in img_vec:
|
|
|
|
|
38 |
sim = cosine_similarity(txt_vec, vec)
|
39 |
sim_matrix.append(sim)
|
40 |
img_idx = np.argmax(sim_matrix)
|
|
|
35 |
def match_img(txt_vec):
|
36 |
sim_matrix = []
|
37 |
for vec in img_vec:
|
38 |
+
vec = vec.reshape(-1, 1)
|
39 |
+
txt_vec = txt_vec.reshape(-1, 1)
|
40 |
sim = cosine_similarity(txt_vec, vec)
|
41 |
sim_matrix.append(sim)
|
42 |
img_idx = np.argmax(sim_matrix)
|