Spaces:
Runtime error
Runtime error
Commit ·
4376446
1
Parent(s): b5cdbb3
update
Browse files235 unmodified lines236237238239240241242243244245246247248249250251252253254255256257258259260261262235 unmodified linesreturn redirect(url_for('completed', username=username))sample = selected_samples[current_index]method_a, method_b = methods# Find matching files for both methodsfile_a = Nonefile_b = Nonemethod_a_dir = get_method_dir(method_a)method_b_dir = get_method_dir(method_b)for category in ['TP', 'TN', 'FP', 'FN']:dir_a = f'htmls_{method_a_dir.upper()}/{category}'dir_b = f'htmls_{method_b_dir.upper()}/{category}'files_a = os.listdir(dir_a)files_b = os.listdir(dir_b)matching_files = set(files_a) & set(files_b)if matching_files:file_a = os.path.join(dir_a, next(iter(matching_files)))file_b = os.path.join(dir_b, next(iter(matching_files)))breakif not file_a or not file_b:logger.error(f"Missing files for comparison at index {current_index}")235 unmodified lines236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266235 unmodified linesreturn redirect(url_for('completed', username=username))sample = selected_samples[current_index]logger.info(f"sample:\n{sample}")method_a, method_b = methods# Find matching files for both methodsmethod_a_dir = get_method_dir(method_a)method_b_dir = get_method_dir(method_b)# for category in ['TP', 'TN', 'FP', 'FN']:category = sample['category']dir_a = f'htmls_{method_a_dir.upper()}/{category}'dir_b = f'htmls_{method_b_dir.upper()}/{category}'file_a = os.path.join(dir_a, sample['file'])file_b = os.path.join(dir_b, sample['file'])# files_a = os.listdir(dir_a)# files_b = os.listdir(dir_b)## matching_files = set(files_a) & set(files_b)# if matching_files:# file_a = os.path.join(dir_a, next(iter(matching_files)))# file_b = os.path.join(dir_b, next(iter(matching_files)))# breakif not file_a or not file_b:logger.error(f"Missing files for comparison at index {current_index}")
app.py+18-14