Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ from appStore.prep_data import process_giz_worldwide, remove_duplicates, get_max
|
|
6 |
from appStore.prep_utils import create_documents, get_client
|
7 |
from appStore.embed import hybrid_embed_chunks
|
8 |
from appStore.search import hybrid_search
|
9 |
-
from appStore.region_utils import load_region_data, get_country_name, get_regions
|
10 |
#from appStore.tfidf_extraction import extract_top_keywords # TF-IDF part commented out
|
11 |
from torch import cuda
|
12 |
import json
|
@@ -295,7 +295,7 @@ def get_country_name_and_region_mapping(_client, collection_name, region_df):
|
|
295 |
country_list = []
|
296 |
else:
|
297 |
country_list = [country.strip()]
|
298 |
-
two_digit_codes = [code
|
299 |
country_set.update(two_digit_codes)
|
300 |
country_name_to_code = {}
|
301 |
iso_code_to_sub_region = {}
|
|
|
6 |
from appStore.prep_utils import create_documents, get_client
|
7 |
from appStore.embed import hybrid_embed_chunks
|
8 |
from appStore.search import hybrid_search
|
9 |
+
from appStore.region_utils import load_region_data, clean_country_code, get_country_name, get_regions
|
10 |
#from appStore.tfidf_extraction import extract_top_keywords # TF-IDF part commented out
|
11 |
from torch import cuda
|
12 |
import json
|
|
|
295 |
country_list = []
|
296 |
else:
|
297 |
country_list = [country.strip()]
|
298 |
+
two_digit_codes = [clean_country_code(code) for code in country_list if len(clean_country_code(code)) == 2]
|
299 |
country_set.update(two_digit_codes)
|
300 |
country_name_to_code = {}
|
301 |
iso_code_to_sub_region = {}
|