Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Jan Mühlnikel
commited on
Commit
·
6a0bd1a
1
Parent(s):
0dc8a67
enhanced documentation
Browse files- app_matching_page.py +9 -4
app_matching_page.py
CHANGED
|
@@ -24,15 +24,20 @@ import gc
|
|
| 24 |
# Load Similarity matrix
|
| 25 |
@st.cache_data
|
| 26 |
def load_sim_matrix():
|
|
|
|
|
|
|
|
|
|
| 27 |
loaded_matrix = load_npz("src/extended_similarities.npz")
|
| 28 |
-
#dense_matrix = loaded_matrix.toarray().astype('float16')
|
| 29 |
|
| 30 |
return loaded_matrix
|
| 31 |
|
| 32 |
# Load Non Similar Orga Matrix
|
|
|
|
| 33 |
def load_nonsameorga_sim_matrix():
|
|
|
|
|
|
|
|
|
|
| 34 |
loaded_matrix = load_npz("src/extended_similarities_nonsimorga.npz")
|
| 35 |
-
#dense_matrix = loaded_matrix.toarray().astype('float16')
|
| 36 |
|
| 37 |
return loaded_matrix
|
| 38 |
|
|
@@ -116,8 +121,8 @@ def load_embeddings_and_index():
|
|
| 116 |
|
| 117 |
|
| 118 |
# USE CACHE FUNCTIONS
|
| 119 |
-
sim_matrix = load_sim_matrix()
|
| 120 |
-
nonsameorgas_sim_matrix = load_nonsameorga_sim_matrix()
|
| 121 |
projects_df, iati_search_list, title_search_list = load_projects()
|
| 122 |
|
| 123 |
CRS3_MERGED = getCRS3()
|
|
|
|
| 24 |
# Load Similarity matrix
|
| 25 |
@st.cache_data
|
| 26 |
def load_sim_matrix():
|
| 27 |
+
"""
|
| 28 |
+
!!! Similarities when matches between same orgas are allowed
|
| 29 |
+
"""
|
| 30 |
loaded_matrix = load_npz("src/extended_similarities.npz")
|
|
|
|
| 31 |
|
| 32 |
return loaded_matrix
|
| 33 |
|
| 34 |
# Load Non Similar Orga Matrix
|
| 35 |
+
#
|
| 36 |
def load_nonsameorga_sim_matrix():
|
| 37 |
+
"""
|
| 38 |
+
!!! Similarities when matches between same orgas are NOT allowed
|
| 39 |
+
"""
|
| 40 |
loaded_matrix = load_npz("src/extended_similarities_nonsimorga.npz")
|
|
|
|
| 41 |
|
| 42 |
return loaded_matrix
|
| 43 |
|
|
|
|
| 121 |
|
| 122 |
|
| 123 |
# USE CACHE FUNCTIONS
|
| 124 |
+
sim_matrix = load_sim_matrix() # For similarities when mathces between same orgas are allowed
|
| 125 |
+
nonsameorgas_sim_matrix = load_nonsameorga_sim_matrix() #For similarities when mathces between same orgas are NOT allowed
|
| 126 |
projects_df, iati_search_list, title_search_list = load_projects()
|
| 127 |
|
| 128 |
CRS3_MERGED = getCRS3()
|