@@ -257,7 +257,7 @@ def _set_params(
257257 if os .path .isdir (cfg .SPECIES_LIST_FILE ):
258258 cfg .SPECIES_LIST_FILE = os .path .join (cfg .SPECIES_LIST_FILE , "species_list.txt" )
259259
260- cfg .SPECIES_LIST = read_lines (cfg .SPECIES_LIST_FILE )
260+ cfg .SPECIES_LIST = read_lines (cfg .SPECIES_LIST_FILE , trim = True , fail_on_blank_lines = True )
261261 else :
262262 cfg .SPECIES_LIST_FILE = None
263263 cfg .SPECIES_LIST = get_species_list (cfg .LATITUDE , cfg .LONGITUDE , cfg .WEEK , cfg .LOCATION_FILTER_THRESHOLD )
@@ -274,17 +274,17 @@ def _set_params(
274274 cfg .LABELS_FILE = None
275275 cfg .LABELS = None
276276 else :
277- cfg .LABELS = read_lines (cfg .LABELS_FILE )
277+ cfg .LABELS = read_lines (cfg .LABELS_FILE , fail_on_blank_lines = True )
278278 else :
279279 cfg .APPLY_SIGMOID = False
280280 # our output format
281281 cfg .LABELS_FILE = os .path .join (custom_classifier , "labels" , "label_names.csv" )
282282
283283 if not os .path .isfile (cfg .LABELS_FILE ):
284284 cfg .LABELS_FILE = os .path .join (custom_classifier , "assets" , "label.csv" )
285- cfg .LABELS = read_lines (cfg .LABELS_FILE )
285+ cfg .LABELS = read_lines (cfg .LABELS_FILE , fail_on_blank_lines = True )
286286 else :
287- cfg .LABELS = [line .split ("," )[1 ] for line in read_lines (cfg .LABELS_FILE )]
287+ cfg .LABELS = [line .split ("," )[1 ] for line in read_lines (cfg .LABELS_FILE , fail_on_blank_lines = True )]
288288
289289 if cfg .LABELS_FILE :
290290 lfile = os .path .join (cfg .TRANSLATED_LABELS_PATH , os .path .basename (cfg .LABELS_FILE ).replace (".txt" , f"_{ locale } .txt" ))
0 commit comments