Spaces:
Runtime error
Runtime error
wrong append
Browse files
pages/4_Vase_Qualities_Comparison.py
CHANGED
@@ -158,11 +158,9 @@ with output_col_2:
|
|
158 |
for c1 in concept_ids:
|
159 |
for c2 in concept_ids:
|
160 |
if c1 != c2:
|
161 |
-
c1 = st.session_state.type_col + ' ' + c1
|
162 |
-
c2 = st.session_state.type_col + ' ' + c2
|
163 |
|
164 |
print(f'Similarity between {c1} and {c2}')
|
165 |
-
similarity = cosine_similarity(vectors_CLIP[c1].reshape(1, -1), vectors_CLIP[c2].reshape(1, -1))
|
166 |
print(np.round(similarity[0][0], 3))
|
167 |
edges_clip.append((c1, c2, np.round(float(np.round(similarity[0][0], 3)), 3)))
|
168 |
|
|
|
158 |
for c1 in concept_ids:
|
159 |
for c2 in concept_ids:
|
160 |
if c1 != c2:
|
|
|
|
|
161 |
|
162 |
print(f'Similarity between {c1} and {c2}')
|
163 |
+
similarity = cosine_similarity(vectors_CLIP[st.session_state.type_col + ' ' + c1].reshape(1, -1), vectors_CLIP[st.session_state.type_col + ' ' + c2].reshape(1, -1))
|
164 |
print(np.round(similarity[0][0], 3))
|
165 |
edges_clip.append((c1, c2, np.round(float(np.round(similarity[0][0], 3)), 3)))
|
166 |
|